feat: harden containers and ci

This commit is contained in:
2025-10-16 22:56:33 -05:00
parent c51604fdb7
commit 8ca2756d7b
14 changed files with 293 additions and 17 deletions

View File

@@ -22,22 +22,27 @@ services:
build:
context: ./backend
dockerfile: Dockerfile
target: dev
container_name: merchantsofhope-supplyanddemandportal-backend
environment:
NODE_ENV: development
DATABASE_URL: postgresql://${POSTGRES_USER:-merchantsofhope_user}:${POSTGRES_PASSWORD}@merchantsofhope-supplyanddemandportal-database:5432/${POSTGRES_DB:-merchantsofhope_supplyanddemandportal}
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is not set}
HOST: ${BACKEND_HOST:-0.0.0.0}
PORT: ${BACKEND_PORT:-3001}
POSTGRES_HOST: merchantsofhope-supplyanddemandportal-database
UPLOAD_DIR: /app/uploads/resumes
RUN_MIGRATIONS: "true"
RUN_SEED: "false"
ports:
- "0.0.0.0:${BACKEND_PORT:-3001}:3001"
command: >
sh -c "npm run migrate && npm run seed && npm run dev"
depends_on:
merchantsofhope-supplyanddemandportal-database:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3001/api/health || exit 1"]
interval: 30s
timeout: 5s
retries: 5
volumes:
- ./backend:/app
- backend-resume-uploads:/app/uploads/resumes