Add docker-compose for local dev

This commit is contained in:
2026-01-27 17:11:04 +00:00
parent 06f1b4e548
commit 54d1bb7240

49
docker-compose.yml Normal file
View File

@@ -0,0 +1,49 @@
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-networkapp123}
POSTGRES_DB: networkapp
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
api:
build: .
restart: unless-stopped
ports:
- "${PORT:-3000}:3000"
environment:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-networkapp123}@db:5432/networkapp
PORT: 3000
APP_URL: ${APP_URL:-http://localhost:3000}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:8080}
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
RESEND_API_KEY: ${RESEND_API_KEY}
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL:-onboarding@resend.dev}
depends_on:
db:
condition: service_healthy
migrate:
build: .
command: ["bun", "run", "db:push"]
environment:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-networkapp123}@db:5432/networkapp
depends_on:
db:
condition: service_healthy
profiles:
- migrate
volumes:
postgres_data: