-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
52 lines (49 loc) · 1.55 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
version: "3.8"
services:
# DATABASE SERVICE CONFIGURATION
database:
image: mysql:latest
environment:
MYSQL_DATABASE: code_inspector_db
MYSQL_ROOT_PASSWORD: root
ports:
- "3306:3306"
# Checks if MySQL server is healthy by running 'mysqladmin ping' every 10 seconds.
# Considers the service unhealthy if the check fails to complete within 5 seconds or fails 3 times in a row.
# Read more: https://docs.docker.com/compose/compose-file
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 3
# BACKEND SERVICE CONFIGURATION
backend:
image:
archontisk/codeinspector
environment:
- DB_URL=mysql+pymysql://root:root@database:3306/code_inspector_db
ports:
- "8000:8000"
depends_on:
database:
# Warning: depends_on does not wait for db to be ready. Read more: https://docs.docker.com/compose/startup-order/
# Conditionally start this service only if the database service is healthy.
# The database service is considered healthy if the healthcheck command exits with a code > 0.
condition: service_healthy
# FRONTEND SERVICE CONFIGURATION
frontend:
build:
context: ./frontend/app
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
# ADMINER SERVICE CONFIGURATION (For database management | localhost:8080 - server: database)
adminer:
image: adminer
restart: always
ports:
- "8080:8080"
depends_on:
- database