build: dockerize app, migrate on boot
This commit is contained in:
36
compose.yml
Normal file
36
compose.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
services:
|
||||
db:
|
||||
image: docker.io/library/postgres:16
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- POSTGRES_USER=postgres
|
||||
- POSTGRES_PASSWORD=pass
|
||||
- POSTGRES_DB=loft
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- loft_db_data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres -d loft"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
app:
|
||||
image: loft
|
||||
restart: unless-stopped
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:pass@db:5432/loft
|
||||
- STORAGE_PATH=/app/storage
|
||||
volumes:
|
||||
- loft_storage:/app/storage
|
||||
|
||||
volumes:
|
||||
loft_db_data:
|
||||
loft_storage:
|
||||
Reference in New Issue
Block a user