Set restart policy to always for all containers

This commit is contained in:
billchenchina 2022-03-20 02:26:49 +08:00
parent 36d47b9b88
commit 9e6cc6b455

View file

@ -9,6 +9,7 @@ services:
- netbox-worker - netbox-worker
env_file: env/netbox.env env_file: env/netbox.env
user: 'unit:root' user: 'unit:root'
restart: "always"
volumes: volumes:
- ./startup_scripts:/opt/netbox/startup_scripts:z,ro - ./startup_scripts:/opt/netbox/startup_scripts:z,ro
- ./initializers:/opt/netbox/initializers:z,ro - ./initializers:/opt/netbox/initializers:z,ro
@ -25,6 +26,7 @@ services:
- /opt/netbox/venv/bin/python - /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py - /opt/netbox/netbox/manage.py
- rqworker - rqworker
restart: "always"
netbox-housekeeping: netbox-housekeeping:
<<: *netbox <<: *netbox
depends_on: depends_on:
@ -32,11 +34,13 @@ services:
- postgres - postgres
command: command:
- /opt/netbox/housekeeping.sh - /opt/netbox/housekeeping.sh
restart: "always"
# postgres # postgres
postgres: postgres:
image: postgres:14-alpine image: postgres:14-alpine
env_file: env/postgres.env env_file: env/postgres.env
restart: "always"
volumes: volumes:
- netbox-postgres-data:/var/lib/postgresql/data - netbox-postgres-data:/var/lib/postgresql/data
@ -48,6 +52,7 @@ services:
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: env/redis.env env_file: env/redis.env
restart: "always"
volumes: volumes:
- netbox-redis-data:/data - netbox-redis-data:/data
redis-cache: redis-cache:
@ -57,6 +62,7 @@ services:
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
env_file: env/redis-cache.env env_file: env/redis-cache.env
restart: "always"
volumes: volumes:
netbox-media-files: netbox-media-files: