fixes for postgres / use official memcached container (#130)
* use fixed postgres & memcached versions & fix missing postgres env var * remove memcached contaienr build * fixed another version label * added postgres password to backup command * set postgres user & pass in .env file * fixed postgres in backup container * use zammad repo
This commit is contained in:
parent
9b81b9f544
commit
607fa4a02a
5
.env
5
.env
@ -1,5 +1,8 @@
|
||||
# don't forget to add the minus before the version
|
||||
# example: VERSION=-2.9.0-1
|
||||
# example: VERSION=-3.2.0-12
|
||||
IMAGE_REPO=zammad/zammad-docker-compose
|
||||
VERSION=
|
||||
RESTART=always
|
||||
POSTGRES_USER=zammad
|
||||
POSTGRES_PASS=zammad
|
||||
POSTGRES_DB=zammad_production
|
||||
|
@ -9,5 +9,5 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
|
||||
org.label-schema.vcs-type="Git" \
|
||||
org.label-schema.vendor="Zammad" \
|
||||
org.label-schema.schema-version="2.9.0" \
|
||||
org.label-schema.schema-version="3.2.0" \
|
||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||
|
@ -10,7 +10,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
|
||||
org.label-schema.vcs-type="Git" \
|
||||
org.label-schema.vendor="Zammad" \
|
||||
org.label-schema.schema-version="2.9.0" \
|
||||
org.label-schema.schema-version="3.2.0" \
|
||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||
|
||||
RUN yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment
|
||||
|
@ -1,23 +0,0 @@
|
||||
FROM memcached:alpine
|
||||
MAINTAINER Zanmmad <info@zammad.org>
|
||||
|
||||
ENV MEMCACHED_SIZE 256M
|
||||
|
||||
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.name="Zammad" \
|
||||
org.label-schema.license="AGPL-3.0" \
|
||||
org.label-schema.description="Docker container for Zammad - Memcached Container" \
|
||||
org.label-schema.url="https://zammad.org" \
|
||||
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
|
||||
org.label-schema.vcs-type="Git" \
|
||||
org.label-schema.vendor="Zammad" \
|
||||
org.label-schema.schema-version="2.9.0" \
|
||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||
|
||||
# docker init
|
||||
USER root
|
||||
COPY containers/zammad-memcached/docker-entrypoint.sh /
|
||||
RUN chmod +x /docker-entrypoint.sh
|
||||
USER memcache
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["zammad-memcached"]
|
@ -1,9 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$1" = 'zammad-memcached' ]; then
|
||||
echo "starting memcached..."
|
||||
|
||||
exec memcached -m "${MEMCACHED_SIZE}"
|
||||
fi
|
@ -1,12 +1,8 @@
|
||||
FROM postgres:9.6-alpine
|
||||
FROM postgres:9.6.17-alpine
|
||||
|
||||
MAINTAINER Zammad <info@zammad.org>
|
||||
ARG BUILD_DATE
|
||||
|
||||
ENV BACKUP_SLEEP 86400
|
||||
ENV HOLD_DAYS 10
|
||||
ENV ZAMMAD_DIR /opt/zammad
|
||||
ENV BACKUP_DIR /var/tmp/zammad
|
||||
|
||||
LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.name="Zammad" \
|
||||
org.label-schema.license="AGPL-3.0" \
|
||||
@ -15,7 +11,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
|
||||
org.label-schema.vcs-type="Git" \
|
||||
org.label-schema.vendor="Zammad" \
|
||||
org.label-schema.schema-version="2.9.0" \
|
||||
org.label-schema.schema-version="3.2.0" \
|
||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||
|
||||
# copy backup script
|
||||
|
@ -2,9 +2,10 @@
|
||||
|
||||
set -e
|
||||
|
||||
: "${ZAMMAD_DIR:=/opt/zammad}"
|
||||
: "${BACKUP_DIR:=/var/tmp/zammad}"
|
||||
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
|
||||
: "${ZAMMAD_RAILSSERVER_PORT:=3000}"
|
||||
: "${POSTGRESQL_USER:=postgres}"
|
||||
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
||||
: "${POSTGRESQL_PORT:=5432}"
|
||||
: "${POSTGRESQL_DB:=zammad_production}"
|
||||
@ -32,7 +33,7 @@ function zammad_backup {
|
||||
fi
|
||||
|
||||
#db backup
|
||||
pg_dump --dbname=postgresql://"${POSTGRESQL_USER}"@"${POSTGRESQL_HOST}":"${POSTGRESQL_PORT}"/"${POSTGRESQL_DB}" | gzip > "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_db.psql.gz
|
||||
pg_dump --dbname=postgresql://"${POSTGRESQL_USER}:${POSTGRESQL_PASSWORD}"@"${POSTGRESQL_HOST}":"${POSTGRESQL_PORT}"/"${POSTGRESQL_DB}" | gzip > "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_db.psql.gz
|
||||
}
|
||||
|
||||
if [ "$1" = 'zammad-backup' ]; then
|
||||
|
@ -37,7 +37,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \
|
||||
org.label-schema.vcs-url="https://github.com/zammad/zammad" \
|
||||
org.label-schema.vcs-type="Git" \
|
||||
org.label-schema.vendor="Zammad" \
|
||||
org.label-schema.schema-version="2.9.0" \
|
||||
org.label-schema.schema-version="3.2.0" \
|
||||
org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up"
|
||||
|
||||
ENV GIT_BRANCH stable
|
||||
|
@ -11,8 +11,8 @@ set -e
|
||||
: "${MEMCACHED_PORT:=11211}"
|
||||
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
||||
: "${POSTGRESQL_PORT:=5432}"
|
||||
: "${POSTGRESQL_USER:=postgres}"
|
||||
: "${POSTGRESQL_PASS:=}"
|
||||
: "${POSTGRESQL_USER:=zammad}"
|
||||
: "${POSTGRESQL_PASS:=zammad}"
|
||||
: "${POSTGRESQL_DB:=zammad_production}"
|
||||
: "${POSTGRESQL_DB_CREATE:=true}"
|
||||
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
|
||||
|
@ -14,6 +14,11 @@ services:
|
||||
volumes:
|
||||
- zammad-backup:/var/tmp/zammad
|
||||
- zammad-data:/opt/zammad
|
||||
environment:
|
||||
- BACKUP_SLEEP=86400
|
||||
- HOLD_DAYS=10
|
||||
- POSTGRESQL_USER=${POSTGRES_USER}
|
||||
- POSTGRESQL_PASSWORD=${POSTGRES_PASS}
|
||||
|
||||
zammad-elasticsearch:
|
||||
image: ${IMAGE_REPO}:zammad-elasticsearch${VERSION}
|
||||
@ -36,8 +41,8 @@ services:
|
||||
- zammad-data:/opt/zammad
|
||||
|
||||
zammad-memcached:
|
||||
command: ["zammad-memcached"]
|
||||
image: ${IMAGE_REPO}:zammad-memcached${VERSION}
|
||||
command: memcached -m 256M
|
||||
image: memcached:1.5.22-alpine
|
||||
restart: ${RESTART}
|
||||
|
||||
zammad-nginx:
|
||||
@ -59,6 +64,9 @@ services:
|
||||
restart: ${RESTART}
|
||||
volumes:
|
||||
- postgresql-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
||||
|
||||
zammad-railsserver:
|
||||
command: ["zammad-railsserver"]
|
||||
|
@ -3,4 +3,4 @@
|
||||
# build hooks config
|
||||
#
|
||||
|
||||
DOCKER_IMAGES="zammad zammad-elasticsearch zammad-memcached zammad-postgresql"
|
||||
DOCKER_IMAGES="zammad zammad-elasticsearch zammad-postgresql"
|
||||
|
Loading…
Reference in New Issue
Block a user