2020-03-05 16:28:07 +00:00
|
|
|
version: "3.7"
|
|
|
|
services:
|
|
|
|
db:
|
2020-03-17 20:55:32 +00:00
|
|
|
image: mysql:8.0.19
|
2020-03-19 21:37:57 +00:00
|
|
|
command: '--default-authentication-plugin=mysql_native_password'
|
2020-03-05 16:28:07 +00:00
|
|
|
restart: always
|
2021-05-31 07:53:18 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
|
|
|
|
interval: 3s
|
|
|
|
retries: 5
|
|
|
|
start_period: 30s
|
2020-03-05 16:28:07 +00:00
|
|
|
secrets:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-password
|
2020-03-05 16:28:07 +00:00
|
|
|
volumes:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-data:/var/lib/mysql
|
2020-03-19 21:37:57 +00:00
|
|
|
networks:
|
|
|
|
- backnet
|
|
|
|
environment:
|
|
|
|
- MYSQL_DATABASE=example
|
|
|
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db-password
|
2021-04-30 20:29:16 +00:00
|
|
|
expose:
|
|
|
|
- 3306
|
|
|
|
- 33060
|
2020-03-19 21:37:57 +00:00
|
|
|
backend:
|
|
|
|
build: backend
|
|
|
|
restart: always
|
|
|
|
secrets:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-password
|
2020-03-19 21:37:57 +00:00
|
|
|
ports:
|
2020-03-23 23:36:46 +00:00
|
|
|
- 5000:5000
|
2020-03-19 21:37:57 +00:00
|
|
|
networks:
|
2020-03-23 23:36:46 +00:00
|
|
|
- backnet
|
|
|
|
- frontnet
|
2021-05-31 07:53:18 +00:00
|
|
|
depends_on:
|
|
|
|
db:
|
|
|
|
condition: service_healthy
|
2020-03-05 16:28:07 +00:00
|
|
|
proxy:
|
|
|
|
build: proxy
|
2020-03-19 21:37:57 +00:00
|
|
|
restart: always
|
2020-03-05 16:28:07 +00:00
|
|
|
ports:
|
2020-03-23 23:36:46 +00:00
|
|
|
- 80:80
|
2021-05-31 07:53:18 +00:00
|
|
|
depends_on:
|
|
|
|
- backend
|
2020-03-19 21:37:57 +00:00
|
|
|
networks:
|
|
|
|
- frontnet
|
2020-03-05 16:28:07 +00:00
|
|
|
volumes:
|
2020-03-19 21:37:57 +00:00
|
|
|
db-data:
|
2020-03-05 16:28:07 +00:00
|
|
|
secrets:
|
|
|
|
db-password:
|
|
|
|
file: db/password.txt
|
2020-03-19 21:37:57 +00:00
|
|
|
networks:
|
|
|
|
backnet:
|
|
|
|
frontnet:
|