2020-03-05 16:28:07 +00:00
|
|
|
services:
|
|
|
|
db:
|
2021-11-08 10:41:35 +00:00
|
|
|
# We use a mariadb image which supports both amd64 & arm64 architecture
|
2022-07-13 12:44:29 +00:00
|
|
|
image: mariadb:10-focal
|
2021-11-08 10:41:35 +00:00
|
|
|
# If you really want to use MySQL, uncomment the following line
|
2022-07-13 12:44:29 +00:00
|
|
|
#image: mysql:8
|
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:
|
2022-07-13 12:44:29 +00:00
|
|
|
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --password="$$(cat /run/secrets/db-password)" --silent']
|
2021-05-31 07:53:18 +00:00
|
|
|
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
|
2022-07-13 12:44:29 +00:00
|
|
|
|
2020-03-19 21:37:57 +00:00
|
|
|
backend:
|
2022-07-13 12:44:29 +00:00
|
|
|
build:
|
|
|
|
context: backend
|
|
|
|
target: builder
|
2020-03-19 21:37:57 +00:00
|
|
|
restart: always
|
|
|
|
secrets:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-password
|
2020-03-19 21:37:57 +00:00
|
|
|
ports:
|
2022-07-13 12:44:29 +00:00
|
|
|
- 8000:8000
|
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
|
2022-07-13 12:44:29 +00:00
|
|
|
|
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
|
2022-07-13 12:44:29 +00:00
|
|
|
|
2020-03-05 16:28:07 +00:00
|
|
|
volumes:
|
2020-03-19 21:37:57 +00:00
|
|
|
db-data:
|
2022-07-13 12:44:29 +00:00
|
|
|
|
2020-03-05 16:28:07 +00:00
|
|
|
secrets:
|
|
|
|
db-password:
|
|
|
|
file: db/password.txt
|
2022-07-13 12:44:29 +00:00
|
|
|
|
2020-03-19 21:37:57 +00:00
|
|
|
networks:
|
|
|
|
backnet:
|
|
|
|
frontnet:
|