-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
129 lines (123 loc) · 4.53 KB
/
docker-compose-prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
version: "3.7"
services:
traefik:
image: traefik:v2.4
container_name: frogsoft-cms-traefik
restart: unless-stopped
networks:
- frogsoft-cms-network
command:
- --api
- --entrypoints.web.address=:${TRAEFIK_ENTRYPOINT_PORT}
- --providers.docker.exposedByDefault=false
ports:
- "${TRAEFIK_ENTRYPOINT_PORT}:${TRAEFIK_ENTRYPOINT_PORT}"
volumes:
# - .:/etc/traefik
# - ./dynamic:/etc/traefik/dynamic
# - ./certs:/etc/traefik/certs
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- "traefik.enable=true" # enable the dashboard
- "traefik.http.routers.traefik.rule=Host(`${TRAEFIK_DASHBOARD_HOST}`)" # domain for dashboard
- "traefik.http.routers.traefik.entrypoints=web"
# - "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.service=api@internal" # points to dashboard
- "traefik.http.routers.traefik.middlewares=traefik-compress"
- "traefik.http.middlewares.traefik-compress.compress=true"
mysql:
image: mysql:8.0.26
container_name: frogsoft-cms-mysql
volumes:
- "./mysql/db_data:/var/lib/mysql"
- "./mysql/conf.d:/etc/mysql/conf.d"
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
networks:
frogsoft-cms-network:
aliases:
- mysql
frogsoft-cms-backend:
depends_on:
- mysql
build: ./backend
image: ${DOCKERHUB_USERNAME}/frogsoft-cms-backend:latest
container_name: frogsoft-cms-backend
restart: unless-stopped
networks:
- frogsoft-cms-network
command:
- "./wait-for-it.sh"
- "mysql:3306"
- "--timeout=120"
- "--"
- "java"
- "org.springframework.boot.loader.JarLauncher"
labels:
- "traefik.enable=true"
- "traefik.http.routers.frogsoft-cms-backend.rule=Host(`${BACKEND_TRAEFIK_HOST}`)"
- "traefik.http.routers.frogsoft-cms-backend.entrypoints=web"
# - "traefik.http.routers.frogsoft-cms-backend.tls=true"
- "traefik.http.services.frogsoft-cms-backend.loadbalancer.server.port=80"
- "traefik.http.routers.frogsoft-cms-backend.middlewares=frogsoft-cms-backend-compress"
- "traefik.http.middlewares.frogsoft-cms-backend-compress.compress=true"
environment:
MYSQL_URL: mysql
MYSQL_DB: ${MYSQL_DATABASE}
MYSQL_USERNAME: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
PORT: 80
JWT_SECRET: ${JWT_SECRET}
JWT_EXPIRATION_DELAY: ${JWT_EXPIRATION_DELAY}
MAIL_HOST: ${MAIL_HOST}
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
expose:
- "80"
frogsoft-cms-user:
build: ./frontend-user
image: ${DOCKERHUB_USERNAME}/frogsoft-cms-user:latest
container_name: frogsoft-cms-user
restart: unless-stopped
networks:
- frogsoft-cms-network
environment:
VITE_BACKEND_URL: "${BACKEND_PORTOCOL}://${BACKEND_TRAEFIK_HOST}:${TRAEFIK_ENTRYPOINT_PORT}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.frogsoft-cms-user.rule=Host(`${FRONTEND_USER_TRAEFIK_HOST}`)"
- "traefik.http.routers.frogsoft-cms-user.entrypoints=web"
# - "traefik.http.routers.frogsoft-cms-user.tls=true"
- "traefik.http.services.frogsoft-cms-user.loadbalancer.server.port=80"
- "traefik.http.routers.frogsoft-cms-user.middlewares=frogsoft-cms-user-compress"
- "traefik.http.middlewares.frogsoft-cms-user-compress.compress=true"
expose:
- "80"
frogsoft-cms-admin:
build: ./frontend-admin
image: ${DOCKERHUB_USERNAME}/frogsoft-cms-admin:latest
container_name: frogsoft-cms-admin
restart: unless-stopped
networks:
- frogsoft-cms-network
environment:
VITE_BACKEND_URL: "${BACKEND_PORTOCOL}://${BACKEND_TRAEFIK_HOST}:${TRAEFIK_ENTRYPOINT_PORT}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.frogsoft-cms-admin.rule=Host(`${FRONTEND_ADMIN_TRAEFIK_HOST}`)"
- "traefik.http.routers.frogsoft-cms-admin.entrypoints=web"
# - "traefik.http.routers.frogsoft-cms-admin.tls=true"
- "traefik.http.services.frogsoft-cms-admin.loadbalancer.server.port=80"
- "traefik.http.routers.frogsoft-cms-admin.middlewares=frogsoft-cms-admin-compress"
- "traefik.http.middlewares.frogsoft-cms-admin-compress.compress=true"
expose:
- "80"
ports:
- "10002:80"
networks:
frogsoft-cms-network:
name: frogsoft-cms-network