Add production Docker setup
- Dockerfile: multi-stage build (deps → builder → standalone runner) - docker-compose.prod.yml: app on port 3010 + PostgreSQL 16 - entrypoint.sh: runs prisma migrate deploy then starts node server - next.config.ts: standalone output for minimal Docker image - .dockerignore: exclude dev files from build context Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3010:3000"
|
||||
environment:
|
||||
DATABASE_URL: "postgresql://lms_user:${DB_PASSWORD}@db:5432/lms_db"
|
||||
BETTER_AUTH_SECRET: "${BETTER_AUTH_SECRET}"
|
||||
BETTER_AUTH_URL: "https://school.second-brain.ru"
|
||||
NEXT_PUBLIC_APP_URL: "https://school.second-brain.ru"
|
||||
RESEND_API_KEY: "${RESEND_API_KEY}"
|
||||
EMAIL_FROM: "${EMAIL_FROM}"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: lms_user
|
||||
POSTGRES_PASSWORD: "${DB_PASSWORD}"
|
||||
POSTGRES_DB: lms_db
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U lms_user -d lms_db"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
Reference in New Issue
Block a user