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

View file

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