feat: add Docker support with single-port deployment
Add complete Docker configuration for containerized deployment: - Multi-stage Dockerfile using official Bun runtime - docker-compose.yml for single-port stack orchestration - Host-mounted database volume with auto-initialization - Custom database init script using bun:sqlite - Entrypoint script for seamless database setup - Environment configuration template - Comprehensive DOCKER.md documentation Key features: - Single exposed port (3001) serving both API and frontend - Database persists in ./data directory on host - Auto-creates database from template on first startup - Health checks for monitoring - Architecture-agnostic (works on x86 and ARM64) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
31
docker-compose.yml
Normal file
31
docker-compose.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
services:
|
||||
quickawards:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: quickawards
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3001:3001"
|
||||
environment:
|
||||
# Application settings
|
||||
NODE_ENV: production
|
||||
PORT: 3001
|
||||
LOG_LEVEL: info
|
||||
|
||||
# Security - IMPORTANT: Change these in production!
|
||||
JWT_SECRET: ${JWT_SECRET:-change-this-in-production}
|
||||
|
||||
# CORS - Set to your domain in production
|
||||
VITE_APP_URL: ${VITE_APP_URL:-}
|
||||
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-}
|
||||
volumes:
|
||||
# Host-mounted database directory
|
||||
# Database will be created at ./data/award.db on first startup
|
||||
- ./data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
Reference in New Issue
Block a user