-
Notifications
You must be signed in to change notification settings - Fork 8
/
compose.yml
80 lines (75 loc) · 2.14 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
services:
backend:
build:
context: .
dockerfile: Dockerfile.backend
ports:
- "127.0.0.1:5050:5000"
depends_on:
redis:
condition: service_started
mysql:
condition: service_healthy
volumes:
# Mount the source files inside the container to allow for Flask hot reloading to work
- "./BackEndFlask/Functions:/app/Functions:rw"
- "./BackEndFlask/controller:/app/controller:rw"
- "./BackEndFlask/core:/app/core:rw"
- "./BackEndFlask/models:/app/models:rw"
networks:
- app-network
environment:
- REDIS_HOST=redis
- FLASK_DEBUG=1
- MYSQL_HOST=mysql
- MYSQL_USER=skillbuilder
- MYSQL_PASSWORD=WasPogil1#
- MYSQL_DATABASE=account
redis:
image: redis:7.2.4
ports: [] # Disable exposed port so that Redis can run inside of the container and not be exposed to host machine.
#- "127.0.0.1:6379:6379" # Remove [] next to ports and uncomemnt this line to expose redis to the system again
networks:
- app-network
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
ports:
- "127.0.0.1:3000:3000"
volumes:
# Mount the source files inside the container to allow for React hot reloading to work
- "./FrontEndReact/src:/app/src:ro"
- "./FrontEndReact/public:/app/public:ro"
# Store React build cache in a volume to allow it to persist between container builds
# This improves startup time
- "frontend-cache:/app/node_modules/.cache"
environment:
- REACT_APP_API_URL=http://localhost:5050/api
networks:
- app-network
mysql:
image: mysql:8.0
restart: always
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: account
MYSQL_USER: skillbuilder
MYSQL_PASSWORD: WasPogil1#
ports:
- "5551:3306"
volumes:
- mysql-data:/var/lib/mysql
networks:
- app-network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
app-network:
driver: bridge
volumes:
mysql-data:
frontend-cache: