PyInventory/deployment/docker-compose.yml

56 wiersze
1.7 KiB
YAML
Czysty Zwykły widok Historia

2020-10-26 17:00:02 +00:00
version: "3.7"
services:
caddy: # https://hub.docker.com/_/caddy
image: caddy:2-alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
2020-11-11 17:33:41 +00:00
- ./volumes/static/:/srv/static/:ro
- ./volumes/media/:/srv/media/:ro
2020-10-26 17:00:02 +00:00
environment:
- HOSTNAME=${HOSTNAME:-localhost}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL:-internal}
inventory:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
hostname: inventory
ports:
- "8000"
env_file: ./common.env
environment:
- DJANGO_SETTINGS_MODULE=inventory_settings
- HOSTNAME=${HOSTNAME:-localhost}
links:
- postgres:postgres
depends_on:
- postgres
- caddy
volumes:
- ./inventory/:/inventory/
- ./volumes/static/:/static/:rw
- ./volumes/media/:/media/:rw
# e.g.: pip cache must be the same value as $XDG_CACHE_HOME !
- ./volumes/cache/:/var/cache/:rw
entrypoint: /inventory/entrypoint.sh
postgres:
# https://hub.docker.com/_/postgres
image: postgres:11-alpine
restart: unless-stopped
hostname: postgres
ports:
- "5432"
env_file: ./common.env
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ./postgres/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh:ro
- ./volumes/postgresql/data/:/var/lib/postgresql/data/:rw