Commit 8554d0c2a58890be99ba1ab0c1fdcb8a948c47e3
1 parent
be3c321b
docker-compose 微服务镜像制作优化步骤
Showing
3 changed files
with
52 additions
and
55 deletions
jeecg-boot/jeecg-cloud-module/docker-compose-base.yml
0 → 100644
1 | +version: '2' | ||
2 | +services: | ||
3 | + jeecg-boot-mysql: | ||
4 | + build: | ||
5 | + context: ../db | ||
6 | + environment: | ||
7 | + MYSQL_ROOT_PASSWORD: root | ||
8 | + MYSQL_ROOT_HOST: '%' | ||
9 | + TZ: Asia/Shanghai | ||
10 | + restart: always | ||
11 | + container_name: jeecg-boot-mysql | ||
12 | + command: | ||
13 | + --character-set-server=utf8mb4 | ||
14 | + --collation-server=utf8mb4_general_ci | ||
15 | + --explicit_defaults_for_timestamp=true | ||
16 | + --lower_case_table_names=1 | ||
17 | + --max_allowed_packet=128M | ||
18 | + --default-authentication-plugin=caching_sha2_password | ||
19 | + ports: | ||
20 | + - 3306:3306 | ||
21 | + | ||
22 | + jeecg-boot-redis: | ||
23 | + image: redis:5.0 | ||
24 | + ports: | ||
25 | + - 6379:6379 | ||
26 | + restart: always | ||
27 | + container_name: jeecg-boot-redis | ||
28 | + hostname: jeecg-boot-redis | ||
29 | + | ||
30 | +# jeecg-boot-rabbitmq: | ||
31 | +# # image: rabbitmq:3-management | ||
32 | +# image: rabbitmq:3 | ||
33 | +# ports: | ||
34 | +# - 5672:5672 | ||
35 | +# # - 15672:15672 | ||
36 | +# restart: always | ||
37 | +# container_name: jeecg-boot-rabbitmq | ||
38 | +# hostname: jeecg-boot-rabbitmq |
jeecg-boot/jeecg-cloud-module/docker-compose.yml
1 | version: '2' | 1 | version: '2' |
2 | services: | 2 | services: |
3 | - jeecg-boot-mysql: | ||
4 | - build: | ||
5 | - context: ../db | ||
6 | - environment: | ||
7 | - MYSQL_ROOT_PASSWORD: root | ||
8 | - MYSQL_ROOT_HOST: '%' | ||
9 | - TZ: Asia/Shanghai | ||
10 | - restart: always | ||
11 | - container_name: jeecg-boot-mysql | ||
12 | - command: | ||
13 | - --character-set-server=utf8mb4 | ||
14 | - --collation-server=utf8mb4_general_ci | ||
15 | - --explicit_defaults_for_timestamp=true | ||
16 | - --lower_case_table_names=1 | ||
17 | - --max_allowed_packet=128M | ||
18 | - --default-authentication-plugin=caching_sha2_password | ||
19 | - ports: | ||
20 | - - 3306:3306 | ||
21 | - | ||
22 | - jeecg-boot-redis: | ||
23 | - image: redis:5.0 | ||
24 | - ports: | ||
25 | - - 6379:6379 | ||
26 | - restart: always | ||
27 | - container_name: jeecg-boot-redis | ||
28 | - hostname: jeecg-boot-redis | ||
29 | - | ||
30 | jeecg-boot-nacos: | 3 | jeecg-boot-nacos: |
31 | - restart: on-failure | 4 | + restart: always |
32 | build: | 5 | build: |
33 | context: ./jeecg-cloud-nacos | 6 | context: ./jeecg-cloud-nacos |
34 | ports: | 7 | ports: |
35 | - 8848:8848 | 8 | - 8848:8848 |
36 | - depends_on: | ||
37 | - - jeecg-boot-mysql | ||
38 | container_name: jeecg-boot-nacos | 9 | container_name: jeecg-boot-nacos |
39 | hostname: jeecg-boot-nacos | 10 | hostname: jeecg-boot-nacos |
40 | 11 | ||
41 | - jeecg-boot-gateway: | ||
42 | - restart: on-failure | ||
43 | - build: | ||
44 | - context: ./jeecg-cloud-gateway | ||
45 | - ports: | ||
46 | - - 9999:9999 | ||
47 | - depends_on: | ||
48 | - - jeecg-boot-nacos | ||
49 | - - jeecg-boot-redis | ||
50 | - container_name: jeecg-boot-gateway | ||
51 | - hostname: jeecg-boot-gateway | ||
52 | - | ||
53 | jeecg-boot-system: | 12 | jeecg-boot-system: |
54 | depends_on: | 13 | depends_on: |
55 | - - jeecg-boot-mysql | ||
56 | - - jeecg-boot-redis | ||
57 | - jeecg-boot-nacos | 14 | - jeecg-boot-nacos |
58 | build: | 15 | build: |
59 | context: ./jeecg-cloud-system-start | 16 | context: ./jeecg-cloud-system-start |
@@ -63,6 +20,18 @@ services: | @@ -63,6 +20,18 @@ services: | ||
63 | environment: | 20 | environment: |
64 | - TZ=Asia/Shanghai | 21 | - TZ=Asia/Shanghai |
65 | 22 | ||
23 | + jeecg-boot-gateway: | ||
24 | + restart: on-failure | ||
25 | + build: | ||
26 | + context: ./jeecg-cloud-gateway | ||
27 | + ports: | ||
28 | + - 9999:9999 | ||
29 | + depends_on: | ||
30 | + - jeecg-boot-nacos | ||
31 | + - jeecg-boot-system | ||
32 | + container_name: jeecg-boot-gateway | ||
33 | + hostname: jeecg-boot-gateway | ||
34 | + | ||
66 | # jeecg-boot-xxljob: | 35 | # jeecg-boot-xxljob: |
67 | # build: | 36 | # build: |
68 | # context: ./jeecg-cloud-xxljob | 37 | # context: ./jeecg-cloud-xxljob |
@@ -70,13 +39,3 @@ services: | @@ -70,13 +39,3 @@ services: | ||
70 | # - 9080:9080 | 39 | # - 9080:9080 |
71 | # container_name: jeecg-boot-xxljob | 40 | # container_name: jeecg-boot-xxljob |
72 | # hostname: jeecg-boot-xxljob | 41 | # hostname: jeecg-boot-xxljob |
73 | - | ||
74 | -# jeecg-boot-rabbitmq: | ||
75 | -# # image: rabbitmq:3-management | ||
76 | -# image: rabbitmq:3 | ||
77 | -# ports: | ||
78 | -# - 5672:5672 | ||
79 | -# # - 15672:15672 | ||
80 | -# restart: always | ||
81 | -# container_name: jeecg-boot-rabbitmq | ||
82 | -# hostname: jeecg-boot-rabbitmq |
jeecg-boot/jeecg-cloud-module/jeecg-cloud-gateway/Dockerfile
@@ -12,4 +12,4 @@ EXPOSE 9999 | @@ -12,4 +12,4 @@ EXPOSE 9999 | ||
12 | 12 | ||
13 | ADD ./target/jeecg-cloud-gateway-3.1.0.jar ./ | 13 | ADD ./target/jeecg-cloud-gateway-3.1.0.jar ./ |
14 | 14 | ||
15 | -CMD sleep 10;java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-gateway-3.1.0.jar | ||
16 | \ No newline at end of file | 15 | \ No newline at end of file |
16 | +CMD sleep 50;java -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -jar jeecg-cloud-gateway-3.1.0.jar | ||
17 | \ No newline at end of file | 17 | \ No newline at end of file |