-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
39 lines (36 loc) · 916 Bytes
/
docker-compose.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
version: '3.8'
services:
web:
build: .
tty: true
ports:
- "5001:5000"
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- DOCKERIZED=true
depends_on:
db:
condition: service_healthy
entrypoint: ["/bin/bash", "-c", "python3 create_database.py && python3 app.py"]
db:
image: mysql:5.7
platform: linux/amd64
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- "3307:3306"
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 1s
timeout: 1s
retries: 10
volumes:
db_data: