Set default values in docker compose

This commit is contained in:
Patrick Jentsch 2023-09-25 10:17:06 +02:00
parent cc6ce6e1f3
commit fcbf9c8cb6
2 changed files with 12 additions and 9 deletions

View File

@ -12,13 +12,15 @@ HOST_GID=
HOST_DOCKER_GID=
# DEFAULT: nopaque
DOCKER_DEFAULT_NETWORK_NAME=nopaque
# DOCKER_DEFAULT_NETWORK_NAME=
# DEFAULT: ./volumes/db/data
DOCKER_DB_SERVICE_DATA_VOLUME_SOURCE_PATH=./volumes/db/data
# NOTE: Use `.` as <project-basedir>
# DOCKER_DB_SERVICE_DATA_VOLUME_SOURCE_PATH=
# DEFAULT: ./volumes/mq/data
DOCKER_MQ_SERVICE_DATA_VOLUME_SOURCE_PATH=./volumes/mq/data
# NOTE: Use `.` as <project-basedir>
# DOCKER_MQ_SERVICE_DATA_VOLUME_SOURCE_PATH=
# NOTE: This must be a network share and it must be available on all
# Docker Swarm nodes, mounted to the same path with the same
@ -26,4 +28,5 @@ DOCKER_MQ_SERVICE_DATA_VOLUME_SOURCE_PATH=./volumes/mq/data
DOCKER_NOPAQUE_SERVICE_DATA_VOLUME_SOURCE_PATH=
# DEFAULT: ./volumes/nopaque/logs
DOCKER_NOPAQUE_SERVICE_LOGS_VOLUME_SOURCE_PATH=./volumes/nopaque/logs
# NOTE: Use `.` as <project-basedir>
# DOCKER_NOPAQUE_SERVICE_LOGS_VOLUME_SOURCE_PATH=.

View File

@ -11,7 +11,7 @@ version: "3.5"
networks:
default:
name: "${DOCKER_DEFAULT_NETWORK_NAME}"
name: "${DOCKER_DEFAULT_NETWORK_NAME:-nopaque}"
services:
db:
@ -20,7 +20,7 @@ services:
restart: unless-stopped
volumes:
- type: bind
source: "${DOCKER_DB_SERVICE_DATA_VOLUME_SOURCE_PATH}"
source: "${DOCKER_DB_SERVICE_DATA_VOLUME_SOURCE_PATH:-./volumes/db/data}"
target: "/var/lib/postgresql/data"
mq:
@ -28,7 +28,7 @@ services:
restart: unless-stopped
volumes:
- type: bind
source: "${DOCKER_MQ_SERVICE_DATA_VOLUME_SOURCE_PATH}"
source: "${DOCKER_MQ_SERVICE_DATA_VOLUME_SOURCE_PATH:-/volumes/mq/data}"
target: "/data"
nopaque:
@ -46,7 +46,7 @@ services:
- NOPAQUE_GID=${HOST_GID}
- DOCKER_GID=${HOST_DOCKER_GID}
- NOPAQUE_DATA_PATH=${DOCKER_NOPAQUE_SERVICE_DATA_VOLUME_SOURCE_PATH}
- NOPAQUE_DOCKER_NETWORK_NAME=${DOCKER_DEFAULT_NETWORK_NAME}
- NOPAQUE_DOCKER_NETWORK_NAME=${DOCKER_DEFAULT_NETWORK_NAME:-nopaque}
- NOPAQUE_LOGS_PATH=/home/nopaque/logs
image: nopaque:latest
restart: unless-stopped
@ -60,5 +60,5 @@ services:
source: "${DOCKER_NOPAQUE_SERVICE_DATA_VOLUME_SOURCE_PATH}"
target: "${DOCKER_NOPAQUE_SERVICE_DATA_VOLUME_SOURCE_PATH}"
- type: bind
source: "${DOCKER_NOPAQUE_SERVICE_LOGS_VOLUME_SOURCE_PATH}"
source: "${DOCKER_NOPAQUE_SERVICE_LOGS_VOLUME_SOURCE_PATH:-./volumes/nopaque/logs}"
target: "/home/nopaque/logs"