Commit 49d3b206 authored by Helfer's avatar Helfer
Browse files

Add restart policy.

parent c653badc
......@@ -31,6 +31,7 @@ services:
build:
context: ./apache
container_name: <GLOBAL_PREFIX>apache
restart: "<RESTART_POLICY>"
ports:
- "<FINALLY_EXPOSED_PORT>:80"
volumes:
......@@ -46,6 +47,7 @@ services:
build:
context: ./postgres
container_name: <GLOBAL_PREFIX>postgres
restart: "<RESTART_POLICY>"
volumes:
- postgres:/var/lib/postgresql/data
env_file:
......@@ -55,6 +57,7 @@ services:
build:
context: ./rdmo
container_name: <GLOBAL_PREFIX>rdmo
restart: "<RESTART_POLICY>"
depends_on:
- postgres
volumes:
......
......@@ -4,6 +4,7 @@ DC_TEMP="docker-compose.yaml"
VARS_ENV=$(shell if [ -f variables.local ]; then echo variables.local; else echo variables.env; fi)
GLOBAL_PREFIX=$(shell cat ${CURDIR}/${VARS_ENV} | grep -Po "(?<=GLOBAL_PREFIX=).*")
FINALLY_EXPOSED_PORT=$(shell cat ${CURDIR}/${VARS_ENV} | grep -Po "(?<=FINALLY_EXPOSED_PORT=)[0-9]+")
RESTART_POLICY=$(shell cat ${CURDIR}/${VARS_ENV} | grep -Po "(?<=RESTART_POLICY=).*")
DOCKER_IN_GROUPS=$(shell groups | grep "docker")
MYID=$(shell id -u)
......@@ -29,6 +30,7 @@ preparations:
| sed 's|<CURDIR>|${CURDIR}|g' \
| sed 's|<GLOBAL_PREFIX>|${GLOBAL_PREFIX}|g' \
| sed 's|<FINALLY_EXPOSED_PORT>|${FINALLY_EXPOSED_PORT}|g' \
| sed 's|<RESTART_POLICY>|${RESTART_POLICY}|g' \
| sed 's|<VARIABLES_FILE>|${VARS_ENV}|g' \
> ${DC_TEMP}
......
# these are to modify the docker-compose.yaml
GLOBAL_PREFIX=rdc-
FINALLY_EXPOSED_PORT=8484
# Docker restart policy (no, on-failure, always, unless-stopped)
# see https://docs.docker.com/compose/compose-file/#restart
RESTART_POLICY=no
# settings inside the containers
VOL=/vol
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment