Deploy: docker-compose.yml mit PostgreSQL-Service
This commit is contained in:
parent
265188a136
commit
70880a7e20
|
|
@ -1,19 +1,35 @@
|
||||||
services:
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:16-alpine
|
||||||
|
container_name: itsm_postgres
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: itsm
|
||||||
|
POSTGRES_USER: itsm
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-}
|
||||||
|
volumes:
|
||||||
|
- ./pgdata:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U itsm -d itsm"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
|
||||||
itsm:
|
itsm:
|
||||||
image: python:3.12-slim
|
image: python:3.12-slim
|
||||||
container_name: itsm_app
|
container_name: itsm_app
|
||||||
command: ["sh", "/bootstrap.sh"]
|
command: ["sh", "/bootstrap.sh"]
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
ports:
|
ports:
|
||||||
- "8090:8090"
|
- "8090:8090"
|
||||||
environment:
|
environment:
|
||||||
ITSM_DATA_DIR: /data
|
DATABASE_URL: postgresql://itsm:${POSTGRES_PASSWORD:-}@postgres:5432/itsm
|
||||||
ITSM_USER: ${ITSM_USER:-moe}
|
|
||||||
ITSM_PASSWORD: ${ITSM_PASSWORD:-}
|
|
||||||
ITSM_SECRET_KEY: ${ITSM_SECRET_KEY:-}
|
ITSM_SECRET_KEY: ${ITSM_SECRET_KEY:-}
|
||||||
AES_DASHBOARD_URL: ${AES_DASHBOARD_URL:-http://host.docker.internal:8080}
|
AES_DASHBOARD_URL: ${AES_DASHBOARD_URL:-http://host.docker.internal:8080}
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data
|
|
||||||
- ./bootstrap.sh:/bootstrap.sh:ro
|
- ./bootstrap.sh:/bootstrap.sh:ro
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue