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