-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (32 loc) · 876 Bytes
/
docker-compose.yml
File metadata and controls
34 lines (32 loc) · 876 Bytes
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
version: '3.8'
services:
ip2location-api:
build:
context: ./api
dockerfile: Dockerfile
container_name: ip2location-api
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- HOST=0.0.0.0
- PORT=3000
- LOG_LEVEL=info
- API_KEY=${API_KEY:-test-key}
- API_SECRET=${API_SECRET:-test-secret}
- DATABASE_PATH=/app/data/primary.db
volumes:
# Mount the database file if it exists locally
- ./api/data:/app/data:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/api/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- ip2location-network
networks:
ip2location-network:
driver: bridge