Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3"
- services:
- db_recipes:
- restart: always
- image: postgres:15-alpine
- volumes:
- - ./postgresql:/var/lib/postgresql/data
- env_file:
- - ./.env
- web_recipes:
- restart: always
- image: vabene1111/recipes
- env_file:
- - ./.env
- volumes:
- - staticfiles:/opt/recipes/staticfiles
- # Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
- - nginx_config:/opt/recipes/nginx/conf.d
- - ./mediafiles:/opt/recipes/mediafiles
- depends_on:
- - db_recipes
- nginx_recipes:
- image: nginx:mainline-alpine
- restart: always
- ports:
- - 8123:80
- env_file:
- - ./.env
- depends_on:
- - web_recipes
- volumes:
- # Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
- - nginx_config:/etc/nginx/conf.d:ro
- - staticfiles:/static:ro
- - ./mediafiles:/media:ro
- backup:
- image: postgres:13
- depends_on:
- - db_recipes
- volumes:
- - ./backup:/backup
- command: >
- bash -c "while true; do
- PGPASSWORD=$$POSTGRES_PASSWORD pg_dump -h db-postgresql -U $$POSTGRES_USER -Fc $$POSTGRES_DB > /backup/$$(date +%Y-%m-%d-%H-%M-%S).dump
- echo ""Backup done at $$(date +%Y-%m-%d_%H:%M:%S)""
- ls -1 /backup/*.dump | head -n -2 | xargs rm -f
- sleep 86400
- done"
- environment:
- POSTGRES_USER: <redacted>
- POSTGRES_PASSWORD: <redacted>
- POSTGRES_DB: <redacted>
- volumes:
- nginx_config:
- staticfiles:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement