757e364af0
Add .dockerignore to exclude node_modules, .git, coverage, .env. Update Dockerfile to install nodejs/npm, copy package.json, run npm install, and build. Update compose.prod.yml to set working_dir, restart no, and use array command. Move drizzle-kit from devDependencies to dependencies.
39 lines
927 B
YAML
39 lines
927 B
YAML
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASS}
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_DB: ${POSTGRES_DB:-polympr}
|
|
volumes:
|
|
- db_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
migrate:
|
|
image: registry.docker.polytech.djalim.fr/polympr:latest
|
|
working_dir: /app
|
|
restart: "no"
|
|
command: ["node", "node_modules/.bin/drizzle-kit", "migrate"]
|
|
env_file: .env
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
|
|
app:
|
|
image: registry.docker.polytech.djalim.fr/polympr:latest
|
|
restart: unless-stopped
|
|
ports:
|
|
- "4430:443"
|
|
env_file: .env
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
|
|
volumes:
|
|
db_data:
|