DOCKER.md
1.71 KB
Docker Deployment Guide
Services
-
frontend: Nuxt static assets served by Nginx (8080) -
backend: ASP.NET Core 8 API (8000) -
postgres: PostgreSQL 16 (15432)
Quick Start
docker compose build
docker compose up -d
Important: docker compose build only builds images. Database tables are initialized when the backend container starts and executes EF Core migrations.
If backend or migrations changed, force rebuild and restart backend:
docker compose build --no-cache backend
docker compose up -d postgres backend
docker compose logs -f backend
You should see logs like Starting database migration and seed and Database migration and seed completed successfully.
Open frontend:
Environment Variables
You can create a .env in repository root to override defaults.
-
POSTGRES_DB(default:robot_production_system) -
POSTGRES_USER(default:robot) -
POSTGRES_PASSWORD(default:robot) -
POSTGRES_PORT(default:15432) -
ASPNETCORE_ENVIRONMENT(default:Production) -
ASPNETCORE_URLS(default:http://+:8000) -
BACKEND_PORT(default:8000) -
NUXT_PUBLIC_API_BASE(default:/api) -
FRONTEND_PORT(default:8080)
Routing
-
GET /-> frontend static app -
/*-> SPA fallback toindex.html -
/api/**-> proxied by Nginx to backend -
/uploads/**-> proxied by Nginx to backend static files
Health Checks
- backend:
GET /health - postgres:
pg_isready
Volumes
-
rps-postgres-data: postgres persistent data -
rps-uploads-data: backend uploads persistent storage
Useful Commands
# view logs
docker compose logs -f
# stop
docker compose down
# stop and remove volumes
docker compose down -v