31b3eb21b4
Build & Push Docker Images / test-backend (push) Successful in 44s
Build & Push Docker Images / test-frontend (push) Successful in 53s
Build & Push Docker Images / build-backend (push) Failing after 50s
Build & Push Docker Images / build-frontend (push) Successful in 54s
Users were wiped on container recreation because they shared the backend_data volume with ephemeral pharmacy/medicine data. Postgres gets its own named volume (postgres_data) that survives deploys. - Add postgres:16-alpine service + postgres_data volume to compose - Add pg + connect-pg-simple deps - userDbGet/userDbRun helpers: PG when PG_URL set, SQLite fallback - Sessions use connect-pg-simple when pgPool available - create-admin.js: PG-aware, SQLite fallback for local dev - push_subscriptions.user_id: plain INTEGER (cross-DB FK dropped) - Tests unchanged — no PG_URL in test env = SQLite fallback Set PG_PASSWORD in server .env before next deploy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
services:
|
|
redis:
|
|
image: redis:alpine
|
|
restart: unless-stopped
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: farmafinder
|
|
POSTGRES_USER: farmafinder
|
|
POSTGRES_PASSWORD: ${PG_PASSWORD:-change-me-in-production}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
|
|
backend:
|
|
image: git.hacecalor.net/ichitux/farmafinder-backend:latest
|
|
build:
|
|
context: .
|
|
dockerfile: backend/Dockerfile
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3001:3001"
|
|
environment:
|
|
PORT: "3001"
|
|
NODE_ENV: production
|
|
SESSION_SECRET: ${SESSION_SECRET:-change-me-in-production}
|
|
CORS_ORIGIN: http://localhost:3000
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: "6379"
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD:-}
|
|
DATABASE_PATH: /app/data/database.sqlite
|
|
FARMACIAS_WEBHOOK_URL: ${FARMACIAS_WEBHOOK_URL:-}
|
|
PG_URL: postgresql://farmafinder:${PG_PASSWORD:-change-me-in-production}@postgres:5432/farmafinder
|
|
volumes:
|
|
- backend_data:/app/data
|
|
depends_on:
|
|
- redis
|
|
- postgres
|
|
|
|
frontend:
|
|
image: git.hacecalor.net/ichitux/farmafinder-frontend:latest
|
|
build: ./frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:80"
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
backend_data:
|
|
postgres_data:
|