[root@mt-lingshui-math math-junior]# cat Dockerfile FROM java:8 MAINTAINER java8 images VOLUME /tmp COPY minte-math-junior-2.0.1.RELEASE.jar app.jar RUN bash -c "touch /app.jar" RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone EXPOSE 6060 ENTRYPOINT ["java","-jar","/app.jar"] ############################################ [root@mt-lingshui-math math-junior]# cat docker-compose.yml version: '3' services: web: image: math-junior:latest build: ./ restart: always ports: - "6060" # volumes: # - "/opt/Docker-Ser-mtmath/math-junior/logs:/logs" # springbt-math-junior02: # container_name: springbt-math-junior02 # image: springbt-math-junior-image # build: ./ # restart: always # ports: # - "3032:6060" # volumes: # - "/opt/Docker-Ser-mtmath/springboot-math-junior/logs:/logs" # networks: # mall-network: # aliases: # - math-junior02 # deploy: # mode: replicated # replicas: 1 # #networks: # mall-network: # driver: bridge
来源:oschina
链接:https://my.oschina.net/wangyunlong/blog/3190688