-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (93 loc) · 2.16 KB
/
Copy pathdocker-compose.yml
File metadata and controls
97 lines (93 loc) · 2.16 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
services:
db:
image: mysql:8.0
container_name: mysql_db
restart: unless-stopped
init: true
cpus: "0.25"
mem_limit: 256m
pids_limit: 200
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- db_data:/var/lib/mysql
- type: tmpfs
target: /tmp
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-uroot", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 5s
timeout: 5s
retries: 10
networks:
- hackaton
api:
container_name: hackaton_api
image: ghcr.io/bigchef-dev/hackaton-app
restart: unless-stopped
init: true
cap_drop:
- ALL
cap_add:
- SETGID
- SETUID
cpus: "0.25"
mem_limit: 64m
pids_limit: 150
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: ${NODE_ENV:-production}
PORT: ${API_PORT:-3001}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT:-3306}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
ports:
- "${API_PORT_HOST:-3001}:${API_PORT:-3001}"
tmpfs:
- /tmp
networks:
- hackaton
- caddy_network
frontend:
image: ghcr.io/bigchef-dev/hackaton-frontend
container_name: hackaton-frontend
build:
context: .
dockerfile: Dockerfile
# Use 'dev' target for development with hot-reload, or 'production' for static serving
target: ${FRONTEND_TARGET:-dev}
restart: unless-stopped
init: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
cpus: "0.25"
mem_limit: 128m
pids_limit: 100
depends_on:
- api
ports:
- "${FRONTEND_PORT_HOST:-5173}:5173"
environment:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-/api}
VITE_API_PROXY_TARGET: ${VITE_API_PROXY_TARGET:-http://api:3001}
tmpfs:
- /tmp
networks:
- hackaton
- caddy_network
volumes:
db_data:
networks:
hackaton:
driver: bridge
caddy_network:
external: true