add restart policy to containers

This commit is contained in:
vos 2020-02-29 22:56:16 +01:00
parent 80f514fa90
commit 97d7df54fc
2 changed files with 9 additions and 0 deletions

View file

@ -2,6 +2,7 @@ version: '3.4'
services: services:
netbox: netbox:
image: ${IMAGE-netboxcommunity/netbox:latest} image: ${IMAGE-netboxcommunity/netbox:latest}
restart: unless-stopped
depends_on: depends_on:
- postgres - postgres
- redis - redis
@ -18,6 +19,7 @@ services:
- netbox-media-files:/opt/netbox/netbox/media:z - netbox-media-files:/opt/netbox/netbox/media:z
nginx: nginx:
command: nginx -c /etc/netbox-nginx/nginx.conf command: nginx -c /etc/netbox-nginx/nginx.conf
restart: unless-stopped
image: nginx:1.17-alpine image: nginx:1.17-alpine
depends_on: depends_on:
- netbox - netbox
@ -28,9 +30,11 @@ services:
- netbox-nginx-config:/etc/netbox-nginx/:ro - netbox-nginx-config:/etc/netbox-nginx/:ro
postgres: postgres:
image: postgres:11-alpine image: postgres:11-alpine
restart: unless-stopped
env_file: env/postgres.env env_file: env/postgres.env
redis: redis:
image: redis:5-alpine image: redis:5-alpine
restart: unless-stopped
command: command:
- sh - sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env

View file

@ -2,6 +2,7 @@ version: '3.4'
services: services:
netbox: &netbox netbox: &netbox
image: netboxcommunity/netbox:${VERSION-latest} image: netboxcommunity/netbox:${VERSION-latest}
restart: unless-stopped
depends_on: depends_on:
- postgres - postgres
- redis - redis
@ -29,6 +30,7 @@ services:
- rqworker - rqworker
nginx: nginx:
command: nginx -c /etc/netbox-nginx/nginx.conf command: nginx -c /etc/netbox-nginx/nginx.conf
restart: unless-stopped
image: nginx:1.17-alpine image: nginx:1.17-alpine
depends_on: depends_on:
- netbox - netbox
@ -39,11 +41,13 @@ services:
- netbox-nginx-config:/etc/netbox-nginx/:ro - netbox-nginx-config:/etc/netbox-nginx/:ro
postgres: postgres:
image: postgres:11-alpine image: postgres:11-alpine
restart: unless-stopped
env_file: env/postgres.env env_file: env/postgres.env
volumes: volumes:
- netbox-postgres-data:/var/lib/postgresql/data - netbox-postgres-data:/var/lib/postgresql/data
redis: redis:
image: redis:5-alpine image: redis:5-alpine
restart: unless-stopped
command: command:
- sh - sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env
@ -53,6 +57,7 @@ services:
- netbox-redis-data:/data - netbox-redis-data:/data
redis-cache: redis-cache:
image: redis:5-alpine image: redis:5-alpine
restart: unless-stopped
command: command:
- sh - sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env - -c # this is to evaluate the $REDIS_PASSWORD from the env