-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-mysql.yml
46 lines (44 loc) · 1.1 KB
/
docker-compose-mysql.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
version: '3'
services:
mariadb:
container_name: mariadb
build:
context: .
dockerfile: Dockerfile-db # MariaDB with an init.sql file to initialize the database
restart: 'always'
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE_NAME}
- MYSQL_HOST_PORT=${MYSQL_HOST_PORT}
- MARIADB_RANDOM_ROOT_PASSWORD=T
healthcheck:
test: [ "CMD", "healthcheck.sh", "--connect", "--innodb_initialized" ]
start_period: 10s
interval: 10s
timeout: 5s
retries: 3
volumes:
- ${HOST_DATA_VOLUME}:${CONTAINER_DATA_VOLUME}
networks:
- chanjo-net
ports:
- "${MYSQL_HOST_PORT}:3306"
api:
container_name: api
build:
context: .
dockerfile: Dockerfile
depends_on:
mariadb:
condition: service_healthy
volumes:
- ./template.env:/home/worker/app/.env
- ${HOST_DATA_VOLUME}:${CONTAINER_DATA_VOLUME}
networks:
- chanjo-net
ports:
- "${CHANJO_HOST_PORT}:8000"
networks:
chanjo-net:
driver: bridge