@@ -0,0 +1,39 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: photohost-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: photohost
|
||||
POSTGRES_PASSWORD: photohost_secret
|
||||
POSTGRES_DB: photohost
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U photohost -d photohost"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: photohost-app
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
DATABASE_URL: postgresql://photohost:photohost_secret@db:5432/photohost?schema=public
|
||||
NODE_ENV: production
|
||||
volumes:
|
||||
- uploads_data:/app/public/uploads
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
uploads_data:
|
||||
Reference in New Issue
Block a user