Files
keywarden/docker-compose.yml.example
boris 3a49d82d04
Some checks failed
CI / Lint & Format (push) Successful in 6s
CI / Docker Build (push) Has been cancelled
CI / Tests (Pytest + Alembic + Postgres) (push) Has been cancelled
Added healthcheck, Added readyz, livez endpoints
2025-09-30 12:20:11 +01:00

53 lines
1.5 KiB
Plaintext

services:
nginx:
container_name: nginx
image: nginx:alpine
restart: unless-stopped
volumes:
- ${DOCKERDIR}/nginx/configs/nginx.conf:/etc/nginx/nginx.conf:ro
- ${DOCKERDIR}/nginx/configs/sites:/etc/nginx/conf.d/
- ${DOCKERDIR}/nginx/certs/:/certs/
- ${DOCKERDIR}/nginx/webdir/:/var/www/
- ${DOCKERDIR}/nginx/logs:/var/log/nginx/
# - "external:internal", change external to desired port
ports:
- "443:443"
nginx-valkey:
image: valkey/valkey:latest
restart: unless-stopped
container_name: nginx-valkey
environment:
- ALLOW_EMPTY_PASSWORD=yes
db:
image: postgres:17-alpine
environment:
POSTGRES_PASSWORD: ${KEYWARDEN_POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${KEYWARDEN_POSTGRES_DB:-keywarden}
POSTGRES_USER: ${KEYWARDEN_POSTGRES_USER:-keywarden}
POSTGRES_PORT: ${KEYWARDEN_POSTGRES_PORT:-5432}
# Do not enable unless debugging, not needed to be exposed outside of docker network
# ports:
# - "5432:5432"
volumes:
- "pgdata:/var/lib/postgresql/data"
api:
build: .
depends_on:
- db
env_file:
- .env
# API runs on port 8000, but is unneeded to be external unless using a custom reverse proxy on another machine
# ports:
# - "8000:8000"
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/healthz"]
interval: 10s
timeout: 5s
retries: 5
volumes:
pgdata: