-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
33 lines (31 loc) · 944 Bytes
/
docker-compose.yml
File metadata and controls
33 lines (31 loc) · 944 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
# Library Management System - Docker Compose Configuration
# Usage: docker-compose up -d
services:
library-api:
build:
context: .
dockerfile: Dockerfile
container_name: library-management
ports:
- "${PORT:-8000}:8000"
volumes:
# Persist library data outside the container
- library-data:/app/data
# Mount the HTML file for easy updates (optional)
- ./index.html:/app/index.html:ro
environment:
- HOST=0.0.0.0
- PORT=8000
- LIBRARY_FILE=/app/data/library.json
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:8000,http://127.0.0.1:8000}
healthcheck:
test: ["CMD", "python", "-c", "import httpx; httpx.get('http://localhost:8000/health').raise_for_status()"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
volumes:
library-data:
driver: local