ENV for external PostgrSQL server?

Hi,

Running the Zammad Docker Compose setup.

I’m just wondering what the ENVs for setting a custom PostgrSQL server are?

Does this look correct?

  zammad-init:
    command: ["zammad-init"]
    depends_on:
      - zammad-postgresql
    environment:
      - POSTGRES_USER=${POSTGRES_USER}
      - POSTGRES_PASSWORD=${POSTGRES_PASS}
      - POSTGRESQL_HOST=${POSTGRES_HOST}
      - POSTGRESQL_NAME=${POSTGRES_NAME}
    image: ${IMAGE_REPO}:zammad${VERSION}
    links:
      - zammad-elasticsearch
    restart: on-failure
    volumes:
      - zammad-data:/opt/zammad

And then remove the zammad-postgresql image?

Also, do I need to set these ENVs in all the places where POSTGRES_USER is set (in the different containers?

Thanks!

Also, what would the equivalent for MySQL be?

I can answer my own question:

For some one else looking for the full answer, this is working (GlusterFS storage backend, PostgreSQL seperate database server, and Traefik proxy):

version: '3.7'

services:

  zammad-elasticsearch:
    environment:
      - discovery.type=single-node
    image: ${IMAGE_REPO}:zammad-elasticsearch${VERSION}
    restart: ${RESTART}
    volumes:
      - elasticsearch-data:/usr/share/elasticsearch/data

  zammad-init:
    command: ["zammad-init"]
    environment:
      - POSTGRESQL_USER=${POSTGRES_USER}
      - POSTGRESQL_PASS=${POSTGRES_PASS}
      - POSTGRESQL_HOST=${POSTGRES_HOST}
      - POSTGRESQL_DB=${POSTGRES_DB}
    image: ${IMAGE_REPO}:zammad${VERSION}
    links:
      - zammad-elasticsearch
    restart: on-failure
    volumes:
      - zammad-data:/opt/zammad

  zammad-memcached:
    command: memcached -m 256M
    image: memcached:1.6.9-alpine
    restart: ${RESTART}

  zammad-nginx:
    command: ["zammad-nginx"]
    depends_on:
      - zammad-railsserver
    image: ${IMAGE_REPO}:zammad${VERSION}
    links:
      - zammad-railsserver
      - zammad-websocket
    restart: ${RESTART}
    volumes:
      - zammad-data:/opt/zammad
    environment:
      - VIRTUAL_HOST=${SWARM_PROD_URL}
      - NGINX_SERVER_SCHEME=https
    networks:
      - default
      - ${PROXY_NETWORK}
    deploy:
        resources:
          limits:
            cpus: '4.0'
            memory: 6GB
        labels:
          - traefik.backend.loadbalancer.stickiness=true
          - traefik.frontend.rule=Host:${SWARM_PROD_URL}
          - traefik.port=8080
        restart_policy:
          condition: any
        update_config:
          parallelism: 1
          order: start-first
        replicas: 1

  zammad-railsserver:
    command: ["zammad-railsserver"]
    depends_on:
      - zammad-memcached
    image: ${IMAGE_REPO}:zammad${VERSION}
    links:
      - zammad-elasticsearch
      - zammad-memcached
    restart: ${RESTART}
    volumes:
      - zammad-data:/opt/zammad

  zammad-scheduler:
    command: ["zammad-scheduler"]
    depends_on:
      - zammad-memcached
      - zammad-railsserver
    image: ${IMAGE_REPO}:zammad${VERSION}
    links:
      - zammad-elasticsearch
      - zammad-memcached
    restart: ${RESTART}
    volumes:
      - zammad-data:/opt/zammad

  zammad-websocket:
    command: ["zammad-websocket"]
    depends_on:
      - zammad-memcached
      - zammad-railsserver
    image: ${IMAGE_REPO}:zammad${VERSION}
    links:
      - zammad-memcached
    restart: ${RESTART}
    volumes:
      - zammad-data:/opt/zammad

volumes:
    elasticsearch-data:
      driver: local
      driver_opts:
        type: none
        o: bind
        device: "${STORAGE}/elasticsearch-data"
    zammad-backup:
      driver: local
      driver_opts:
        type: none
        o: bind
        device: "${STORAGE}/zammad-backup"
    zammad-data:
      driver: local
      driver_opts:
        type: none
        o: bind
        device: "${STORAGE}/zammad-data"

networks:
     traefik-net:
         external: true
1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.