Skip to content

Commit

Permalink
Simplify ENV handling by using default values in the YAML
Browse files Browse the repository at this point in the history
  • Loading branch information
mgruner committed Jun 10, 2024
1 parent 7ea30cb commit 81f1adf
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
30 changes: 15 additions & 15 deletions .env
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
ELASTICSEARCH_VERSION=8.12.2
IMAGE_REPO=ghcr.io/zammad/zammad
MEMCACHE_SERVERS=zammad-memcached:11211
MEMCACHE_VERSION=1.6.25-alpine
POSTGRES_DB=zammad_production
POSTGRES_PASS=zammad
POSTGRES_USER=zammad
POSTGRES_HOST=zammad-postgresql
POSTGRES_PORT=5432
POSTGRES_VERSION=15.6-alpine
POSTGRESQL_OPTIONS=?pool=50
REDIS_URL=redis://zammad-redis:6379
REDIS_VERSION=7.2.4-alpine
RESTART=always
# ELASTICSEARCH_VERSION=8.12.2
# IMAGE_REPO=ghcr.io/zammad/zammad
# MEMCACHE_SERVERS=zammad-memcached:11211
# MEMCACHE_VERSION=1.6.25-alpine
# POSTGRES_DB=zammad_production
# POSTGRES_PASS=zammad
# POSTGRES_USER=zammad
# POSTGRES_HOST=zammad-postgresql
# POSTGRES_PORT=5432
# POSTGRES_VERSION=15.6-alpine
# POSTGRESQL_OPTIONS=?pool=50
# REDIS_URL=redis://zammad-redis:6379
# REDIS_VERSION=7.2.4-alpine
# RESTART=always
# Use a fixed version. You are responsible to update this to newer patch level versions yourself.
VERSION=6.3.1
# VERSION=6.3.1
# You can also use floating versions that will give you automatic updates:
# VERSION=6.2 # all patchlevel updates
# VERSION=6 # including minor updates
Expand Down
48 changes: 24 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ version: '3.8'
x-shared:
zammad-service: &zammad-service
environment: &zammad-environment
MEMCACHE_SERVERS: ${MEMCACHE_SERVERS}
POSTGRESQL_DB: ${POSTGRES_DB}
POSTGRESQL_HOST: ${POSTGRES_HOST}
POSTGRESQL_USER: ${POSTGRES_USER}
POSTGRESQL_PASS: ${POSTGRES_PASS}
POSTGRESQL_PORT: ${POSTGRES_PORT}
REDIS_URL: ${REDIS_URL}
MEMCACHE_SERVERS: ${MEMCACHE_SERVERS:-zammad-memcached:11211}
POSTGRESQL_DB: ${POSTGRES_DB:-zammad_production}
POSTGRESQL_HOST: ${POSTGRES_HOST:-zammad-postgresql}
POSTGRESQL_USER: ${POSTGRES_USER:-zammad}
POSTGRESQL_PASS: ${POSTGRES_PASS:-zammad}
POSTGRESQL_PORT: ${POSTGRES_PORT:-5432}
POSTGRESQL_OPTIONS: ${POSTGRESQL_OPTIONS:-?pool=50}
POSTGRESQL_DB_CREATE:
REDIS_URL: ${REDIS_URL:-redis://zammad-redis:6379}
# Allow passing in these variables via .env:
AUTOWIZARD_JSON:
AUTOWIZARD_RELATIVE_PATH:
Expand All @@ -24,15 +26,13 @@ x-shared:
NGINX_PORT:
NGINX_SERVER_NAME:
NGINX_SERVER_SCHEME:
POSTGRESQL_DB_CREATE:
POSTGRESQL_OPTIONS:
RAILS_TRUSTED_PROXIES:
ZAMMAD_WEB_CONCURRENCY:
ZAMMAD_SESSION_JOBS:
ZAMMAD_PROCESS_SCHEDULED:
ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS:
image: ${IMAGE_REPO}:${VERSION}
restart: ${RESTART}
image: ${IMAGE_REPO:-ghcr.io/zammad/zammad}:${VERSION:-6.3.1}
restart: ${RESTART:-always}
volumes:
- zammad-storage:/opt/zammad/storage
depends_on:
Expand All @@ -53,16 +53,16 @@ services:
BACKUP_TIME: "03:00"
HOLD_DAYS: "10"
TZ: Europe/Berlin
image: postgres:${POSTGRES_VERSION}
restart: ${RESTART}
image: postgres:${POSTGRES_VERSION:-15.6-alpine}
restart: ${RESTART:-always}
volumes:
- zammad-backup:/var/tmp/zammad
- zammad-storage:/opt/zammad/storage:ro
- ./scripts/backup.sh:/usr/local/bin/backup.sh:ro

zammad-elasticsearch:
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION}
restart: ${RESTART}
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION:-8.12.2}
restart: ${RESTART:-always}
volumes:
- elasticsearch-data:/bitnami/elasticsearch/data

Expand All @@ -78,8 +78,8 @@ services:

zammad-memcached:
command: memcached -m 256M
image: memcached:${MEMCACHE_VERSION}
restart: ${RESTART}
image: memcached:${MEMCACHE_VERSION:-1.6.25-alpine}
restart: ${RESTART:-always}

zammad-nginx:
<<: *zammad-service
Expand All @@ -91,11 +91,11 @@ services:

zammad-postgresql:
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASS}
image: postgres:${POSTGRES_VERSION}
restart: ${RESTART}
POSTGRES_DB: ${POSTGRES_DB:-zammad_production}
POSTGRES_USER: ${POSTGRES_USER:-zammad}
POSTGRES_PASSWORD: ${POSTGRES_PASS:-zammad}
image: postgres:${POSTGRES_VERSION:-15.6-alpine}
restart: ${RESTART:-always}
volumes:
- postgresql-data:/var/lib/postgresql/data

Expand All @@ -104,8 +104,8 @@ services:
command: ["zammad-railsserver"]

zammad-redis:
image: redis:${REDIS_VERSION}
restart: ${RESTART}
image: redis:${REDIS_VERSION:-7.2.4-alpine}
restart: ${RESTART:-always}
volumes:
- redis-data:/data

Expand Down

0 comments on commit 81f1adf

Please sign in to comment.