-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
52 lines (49 loc) Β· 1.33 KB
/
docker-compose.yml
File metadata and controls
52 lines (49 loc) Β· 1.33 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
services:
app:
image: ghcr.io/liddiard/traintracker:latest
container_name: traintracker-app
restart: unless-stopped
env_file: .env
environment:
# Override DATABASE_URL for Docker path (uses /app/data for persistence)
- DATABASE_URL=file:/app/data/app.db
# Always use port 3000 internally (nginx proxies to this)
- PORT=3000
volumes:
# Persist only the SQLite database file, not the entire db directory
# This ensures new migrations from updated images are visible
- db-data:/app/data
networks:
- traintracker-network
healthcheck:
test:
[
'CMD',
'node',
'-e',
"require('http').get('http://localhost:3000/api/notifications/vapid-key', (r) => process.exit(r.statusCode === 200 ? 0 : 1))",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
nginx:
image: nginx:alpine
container_name: traintracker-nginx
restart: unless-stopped
ports:
- '127.0.0.1:${PORT:-8724}:80'
volumes:
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
app:
condition: service_healthy
networks:
- traintracker-network
volumes:
db-data:
name: traintracker-db
networks:
traintracker-network:
name: traintracker-network
driver: bridge