Files
ProjectE/docker-compose.yml
T
mbatchelder 73335484f8 feat: migrate from PocketBase to PostgreSQL with Drizzle ORM
- Add @project-e/db package with Drizzle schema and migrations
- Replace PocketBase client with PostgreSQL-based database client
- Migrate auth from custom to NextAuth.js
- Add Docker Compose with PostgreSQL container
- Update worker to use new database client
- Remove PocketBase-specific files and migrations
- Add drizzle config and initial migration
2026-07-24 07:08:29 -04:00

80 lines
2.4 KiB
YAML

services:
web:
build:
context: .
dockerfile: Dockerfile.web
container_name: project-e-web
# For Nginx Proxy Manager: Don't expose ports directly
# NPM will connect via Docker network using container name
# Only uncomment ports if you need direct access for debugging
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://project_e:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}@db:5432/project_e
- NEXTAUTH_URL=${PUBLIC_URL:-http://localhost:3000}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:?Set NEXTAUTH_SECRET}
- INITIAL_ADMIN_EMAIL=${INITIAL_ADMIN_EMAIL:?Set INITIAL_ADMIN_EMAIL}
- INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD:?Set INITIAL_ADMIN_PASSWORD}
- PUBLIC_URL=${PUBLIC_URL:-http://localhost:3000}
- COOKIE_SECURE=${COOKIE_SECURE:-false}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-localhost}
volumes:
- project-e-web-uploads:/tmp/uploads
networks:
- project-e-network
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3000/api/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
db:
image: postgres:16-alpine
container_name: project-e-db
ports:
- "5432:5432"
environment:
- POSTGRES_DB=project_e
- POSTGRES_USER=project_e
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}
volumes:
- project-e-pg-data:/var/lib/postgresql/data
- ./drizzle/0000_first_mauler.sql:/docker-entrypoint-initdb.d/0000_first_mauler.sql:ro
networks:
- project-e-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U project_e -d project_e"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
worker:
build:
context: .
dockerfile: Dockerfile.worker
container_name: project-e-worker
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://project_e:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}@db:5432/project_e
networks:
- project-e-network
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
project-e-network:
driver: bridge
volumes:
project-e-pg-data:
project-e-web-uploads: