feat: Add Docker support with development and production configurations

This commit is contained in:
2025-08-04 15:56:11 +02:00
parent ec1dbaa2a7
commit 6aa0a659cc
8 changed files with 216 additions and 2 deletions

32
docker-compose.yml Normal file
View File

@@ -0,0 +1,32 @@
version: '3.8'
services:
inventory-app:
build: .
ports:
- "3000:3000"
volumes:
# Mount database directory to persist data
- ./data:/app/data
# Mount the database file specifically
- ./database.db:/app/database.db
environment:
- NODE_ENV=production
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Optional: Add a lightweight web server for reverse proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- inventory-app
restart: unless-stopped