build: dockerize app, migrate on boot

This commit is contained in:
2026-06-04 00:07:55 +03:00
parent 91932d38ce
commit f8c56623a4
5 changed files with 83 additions and 2 deletions

36
compose.yml Normal file
View 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: