diff --git a/containers/zammad-backup/Dockerfile b/containers/zammad-backup/Dockerfile deleted file mode 100644 index 28588c5..0000000 --- a/containers/zammad-backup/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM debian -MAINTAINER Zammad -ARG BUILD_DATE - -ENV BACKUP_SLEEP 86400 -ENV HOLD_DAYS 10 -ENV ZAMMAD_DIR /home/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" \ - org.label-schema.description="Docker container for Zammad - Backup 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="1.2" \ - org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" - -RUN apt-get update;apt-get -y wget gnupg2 \ - && wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - \ - && echo "deb http://apt.postgresql.org/pub/repos/apt/ wheezy-pgdg main" >> /etc/apt/sources.list.d/postgres.list \ - && apt-get update;apt-get -y install postgresql-client \ - && rm -rf /var/lib/apt/lists/* - -# create entrypoint -COPY containers/zammad-backup/docker-entrypoint.sh / -RUN chmod +x /docker-entrypoint.sh - -# docker init -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["zammad-backup"] diff --git a/containers/zammad-postgresql/Dockerfile b/containers/zammad-postgresql/Dockerfile index 648fb21..2b3e3c3 100644 --- a/containers/zammad-postgresql/Dockerfile +++ b/containers/zammad-postgresql/Dockerfile @@ -2,6 +2,11 @@ FROM postgres:9.6-alpine MAINTAINER Zammad ARG BUILD_DATE +ENV BACKUP_SLEEP 86400 +ENV HOLD_DAYS 10 +ENV ZAMMAD_DIR /home/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" \ @@ -12,3 +17,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vendor="Zammad" \ org.label-schema.schema-version="1.2" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" + +# copy backup script +COPY containers/zammad-postgresql/backup.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/backup.sh diff --git a/containers/zammad-backup/docker-entrypoint.sh b/containers/zammad-postgresql/backup.sh similarity index 100% rename from containers/zammad-backup/docker-entrypoint.sh rename to containers/zammad-postgresql/backup.sh diff --git a/docker-compose.yml b/docker-compose.yml index 45d389e..b7994a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: zammad-backup: depends_on: - zammad-railsserver - image: zammad/zammad-docker-compose:zammad-backup + image: zammad/zammad-docker-compose:zammad-postgresql labels: io.rancher.container.pull_image: always links: @@ -14,6 +14,8 @@ services: volumes: - data-zammad:/home/zammad - backup-zammad:/var/tmp/zammad + entrypoint: /usr/local/bin/backup.sh + command: zammad-backup zammad-elasticsearch: image: zammad/zammad-docker-compose:zammad-elasticsearch diff --git a/hooks/config b/hooks/config index 38886e0..34af82b 100644 --- a/hooks/config +++ b/hooks/config @@ -3,4 +3,4 @@ # build hooks config # -DOCKER_IMAGES="zammad zammad-backup zammad-elasticsearch zammad-nginx zammad-postgresql" +DOCKER_IMAGES="zammad zammad-elasticsearch zammad-nginx zammad-postgresql"