-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (59 loc) · 1.41 KB
/
docker-compose.yml
File metadata and controls
62 lines (59 loc) · 1.41 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
# Split-It Production Deployment
# ================================
# Start: docker compose up -d
# Stop: docker compose down
# Logs: docker compose logs -f
# Rebuild: docker compose up -d --build
#
# Prerequisites:
# 1. Copy .env.example to .env and fill values
# 2. Build frontend: npm run build
# 3. Update nginx.conf with your domain
services:
api:
build: .
container_name: split-it-api
restart: unless-stopped
ports:
- "5000:5000"
environment:
- NODE_ENV=production
- PORT=5000
env_file:
- .env
volumes:
- uploads:/app/uploads
- logs:/app/logs
healthcheck:
test: [ "CMD", "node", "-e", "require('http').get('http://localhost:5000/health', r => process.exit(r.statusCode === 200 ? 0 : 1))" ]
interval: 30s
timeout: 10s
start_period: 40s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
nginx:
image: nginx:alpine
container_name: split-it-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./build:/usr/share/nginx/html:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
depends_on:
api:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
uploads:
logs: