-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (56 loc) · 1.24 KB
/
docker-compose.yml
File metadata and controls
59 lines (56 loc) · 1.24 KB
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
services:
# MariaDB Database
database:
image: mariadb:12.0
container_name: fermiurl_db
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: root123
MYSQL_DATABASE: url_shortener
ports:
- "3306:3306"
volumes:
- mariadb_data:/var/lib/mysql
- ./backend/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
# Flask Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: fermiurl_backend
restart: unless-stopped
environment:
DB_HOST: database
DB_USER: root
DB_PASSWORD: root123
DB_NAME: url_shortener
ports:
- "5000:5000"
depends_on:
database:
condition: service_healthy
volumes:
- ./backend:/app
# React Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: fermiurl_frontend
restart: unless-stopped
ports:
- "5173:5173"
depends_on:
- backend
volumes:
- ./frontend:/app
- /app/node_modules
stdin_open: true
tty: true
volumes:
mariadb_data: