Commit 3eb1263c4f93f18c5ff424deb16fc2b888eea538
1 parent
b2cac411
微服务docker镜像制作
Showing
3 changed files
with
36 additions
and
1 deletions
jeecg-boot/jeecg-boot-module-demo/Dockerfile
0 → 100644
1 | +FROM anapsix/alpine-java:8_server-jre_unlimited | |
2 | + | |
3 | +MAINTAINER jeecgos@163.com | |
4 | + | |
5 | +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime | |
6 | + | |
7 | +RUN mkdir -p /jeecg-cloud-demo | |
8 | + | |
9 | +WORKDIR /jeecg-cloud-demo | |
10 | + | |
11 | +EXPOSE 7002 | |
12 | + | |
13 | +ADD ./target/jeecg-boot-module-demo-3.3.0.jar ./ | |
14 | + | |
15 | +CMD sleep 10;java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-boot-module-demo-3.3.0.jar | |
0 | 16 | \ No newline at end of file |
... | ... |
jeecg-boot/jeecg-boot-module-demo/pom.xml
... | ... | @@ -21,7 +21,16 @@ |
21 | 21 | <profiles> |
22 | 22 | <profile> |
23 | 23 | <id>SpringCloud</id> |
24 | - <!-- 引入微服务启动 Starter依赖 --> | |
24 | + <!-- 引入springboot独立启动--> | |
25 | + <build> | |
26 | + <plugins> | |
27 | + <plugin> | |
28 | + <groupId>org.springframework.boot</groupId> | |
29 | + <artifactId>spring-boot-maven-plugin</artifactId> | |
30 | + </plugin> | |
31 | + </plugins> | |
32 | + </build> | |
33 | + <!-- 引入微服务Starter依赖 --> | |
25 | 34 | <dependencies> |
26 | 35 | <dependency> |
27 | 36 | <groupId>org.jeecgframework.boot</groupId> |
... | ... |
jeecg-boot/jeecg-cloud-module/docker-compose.yml
... | ... | @@ -20,6 +20,17 @@ services: |
20 | 20 | environment: |
21 | 21 | - TZ=Asia/Shanghai |
22 | 22 | |
23 | + jeecg-boot-demo: | |
24 | + depends_on: | |
25 | + - jeecg-boot-nacos | |
26 | + build: | |
27 | + context: ../jeecg-boot-module-demo | |
28 | + container_name: jeecg-boot-demo | |
29 | + hostname: jeecg-boot-demo | |
30 | + restart: on-failure | |
31 | + environment: | |
32 | + - TZ=Asia/Shanghai | |
33 | + | |
23 | 34 | jeecg-boot-gateway: |
24 | 35 | restart: on-failure |
25 | 36 | build: |
... | ... |