feat (docker): add Dockerfile and docker-compose for containerized setup

This commit is contained in:
Thibault Pouch
2026-03-03 15:15:57 +01:00
parent 53c5d952b5
commit 72a9fbdd74
3 changed files with 105 additions and 0 deletions

43
docker-compose.yml Normal file
View File

@@ -0,0 +1,43 @@
version: '3.8'
services:
postgres:
image: postgres:16-alpine
container_name: wyview-postgres
restart: unless-stopped
environment:
POSTGRES_USER: wyview
POSTGRES_PASSWORD: wyview_password
POSTGRES_DB: wyview
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wyview"]
interval: 10s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
args:
DATABASE_URL: postgresql://wyview:wyview_password@postgres:5432/wyview
container_name: wyview-app
restart: unless-stopped
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://wyview:wyview_password@postgres:5432/wyview
- NEXTAUTH_URL=http://localhost:3001
- NEXTAUTH_SECRET=your-secret-key-change-this-in-production
depends_on:
postgres:
condition: service_healthy
command: sh -c "npx prisma migrate deploy && npm start"
volumes:
postgres_data: