docker compose
This commit is contained in:
@@ -2,38 +2,34 @@
|
||||
services:
|
||||
app:
|
||||
image: node:22-alpine
|
||||
container_name: bizmatch-app-prod
|
||||
container_name: bizmatch-app
|
||||
working_dir: /app
|
||||
volumes:
|
||||
- ./:/app # Code liegt hier direkt im Ordner der Compose
|
||||
ports:
|
||||
- '3001:3000' # Host 3001 -> Container 3000
|
||||
env_file:
|
||||
- path: ./env.prod
|
||||
- path: ./.env
|
||||
required: true
|
||||
environment:
|
||||
- NODE_ENV=development # Prod-Modus (vorher stand fälschlich "development")
|
||||
- DB_HOST=postgres-prod
|
||||
- DB_PORT=5432
|
||||
- DB_NAME=${POSTGRES_DB}
|
||||
- DB_USER=${POSTGRES_USER}
|
||||
- DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- DATABASE_URL
|
||||
# Hinweis: npm ci nutzt package-lock.json; falls nicht vorhanden, nimm "npm install"
|
||||
command: sh -c "npm ci && npm run build && node dist/src/main.js"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- postgres-prod
|
||||
- postgres
|
||||
networks:
|
||||
- bizmatch-prod
|
||||
- bizmatch
|
||||
|
||||
postgres-prod:
|
||||
container_name: bizmatchdb-prod
|
||||
postgres:
|
||||
container_name: bizmatchdb
|
||||
image: postgres:17-alpine # Version pinnen ist stabiler als "latest"
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./bizmatchdb-data-prod:/var/lib/postgresql/data # Daten liegen im Server-Repo
|
||||
- ${PWD}/bizmatchdb-data:/var/lib/postgresql/data # Daten liegen im Server-Repo
|
||||
env_file:
|
||||
- path: ./env.prod
|
||||
- path: ./.env
|
||||
required: true
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
@@ -42,8 +38,8 @@ services:
|
||||
ports:
|
||||
- '5433:5432' # Host 5433 -> Container 5432
|
||||
networks:
|
||||
- bizmatch-prod
|
||||
- bizmatch
|
||||
|
||||
networks:
|
||||
bizmatch-prod:
|
||||
bizmatch:
|
||||
external: true # einmalig anlegen: docker network create bizmatch-prod
|
||||
|
||||
Reference in New Issue
Block a user