2020-03-05 18:02:53 +00:00
|
|
|
services:
|
|
|
|
backend:
|
|
|
|
build: backend
|
2021-03-22 08:58:41 +00:00
|
|
|
restart: always
|
|
|
|
secrets:
|
|
|
|
- db-password
|
2020-03-17 15:28:17 +00:00
|
|
|
environment:
|
|
|
|
MYSQL_HOST: db
|
|
|
|
networks:
|
|
|
|
- react-spring
|
|
|
|
- spring-mysql
|
|
|
|
depends_on:
|
2021-03-22 08:58:41 +00:00
|
|
|
db:
|
|
|
|
condition: service_healthy
|
2020-03-05 18:02:53 +00:00
|
|
|
db:
|
|
|
|
environment:
|
|
|
|
MYSQL_DATABASE: example
|
|
|
|
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db-password
|
2020-03-17 15:28:17 +00:00
|
|
|
image: mysql:8.0.19
|
2020-03-05 18:02:53 +00:00
|
|
|
restart: always
|
2021-03-22 08:58:41 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
|
|
|
|
interval: 3s
|
|
|
|
retries: 5
|
|
|
|
start_period: 30s
|
2020-03-05 18:02:53 +00:00
|
|
|
secrets:
|
2020-03-17 15:28:17 +00:00
|
|
|
- db-password
|
2020-03-05 18:02:53 +00:00
|
|
|
volumes:
|
2020-03-17 15:28:17 +00:00
|
|
|
- db-data:/var/lib/mysql
|
|
|
|
networks:
|
|
|
|
- spring-mysql
|
2020-03-05 18:02:53 +00:00
|
|
|
frontend:
|
2020-03-23 10:18:04 +00:00
|
|
|
build:
|
|
|
|
context: frontend
|
|
|
|
target: development
|
2020-03-05 18:02:53 +00:00
|
|
|
ports:
|
2020-03-23 10:18:04 +00:00
|
|
|
- 3000:3000
|
2020-03-05 18:02:53 +00:00
|
|
|
volumes:
|
2020-03-23 10:18:04 +00:00
|
|
|
- ./frontend/src:/code/src
|
2020-03-17 15:28:17 +00:00
|
|
|
- /project/node_modules
|
|
|
|
networks:
|
|
|
|
- react-spring
|
|
|
|
depends_on:
|
|
|
|
- backend
|
2021-04-30 20:29:16 +00:00
|
|
|
expose:
|
|
|
|
- 3306
|
|
|
|
- 33060
|
2020-03-05 18:02:53 +00:00
|
|
|
volumes:
|
|
|
|
db-data: {}
|
|
|
|
secrets:
|
|
|
|
db-password:
|
|
|
|
file: db/password.txt
|
2020-03-17 15:28:17 +00:00
|
|
|
networks:
|
|
|
|
react-spring: {}
|
2020-03-23 10:18:04 +00:00
|
|
|
spring-mysql: {}
|