Compare commits
169 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
799edd7863 | ||
|
6606e8e2ca | ||
|
662aa8f512 | ||
|
ffa1268a2a | ||
|
3338cbeb22 | ||
|
9a547c67a9 | ||
|
1c52589095 | ||
|
281b5f317f | ||
|
ef8830e636 | ||
|
a8911b1359 | ||
|
1f32908c23 | ||
|
360324353f | ||
|
e5b0fedfe6 | ||
|
d588f2ff65 | ||
|
01fe85d74c | ||
|
abd9cd631d | ||
|
d397322bae | ||
|
ae716aed3d | ||
|
ad516bdfd6 | ||
|
87e8b49794 | ||
|
a0aa5324dc | ||
|
731f83da2b | ||
|
c5c1db541a | ||
|
0af24d791f | ||
|
cd424e9868 | ||
|
daa1c71e00 | ||
|
52bced15fe | ||
|
225ee21d5f | ||
|
f57418a2a5 | ||
|
130f22766c | ||
|
b4779f1be0 | ||
|
10fa5096c7 | ||
|
5a65ce28cf | ||
|
d3e27a5828 | ||
|
bf95bf7fa4 | ||
|
d1a0e023c7 | ||
|
44ae0bfd18 | ||
|
893fd870d5 | ||
|
834ede5ffe | ||
|
fe5481e89a | ||
|
d3308a6e77 | ||
|
c43b89fcb4 | ||
|
b308627f3d | ||
|
cc6207c354 | ||
|
4799b327d2 | ||
|
8d24441c85 | ||
|
b5b1d7bb9e | ||
|
5bcd41057a | ||
|
c6be2e5326 | ||
|
a3c0a7e39c | ||
|
5ee8fb4a0c | ||
|
1cfaaef188 | ||
|
8761f57cf7 | ||
|
66bd5725a0 | ||
|
0b1d50f532 | ||
|
3e465c6ce7 | ||
|
6ae09345ad | ||
|
09e1e6b2d7 | ||
|
60a6fc202f | ||
|
acf378a8f7 | ||
|
7a0ba8ce35 | ||
|
e697dcd493 | ||
|
17c5d209bd | ||
|
efbe666429 | ||
|
9842a689e4 | ||
|
bf534fbd5d | ||
|
0d262239b8 | ||
|
a703b63cb1 | ||
|
01daa74920 | ||
|
c5a6f5afec | ||
|
4b22c2e442 | ||
|
7458686643 | ||
|
cda3c41c7a | ||
|
defd3fbdcf | ||
|
701627f9c6 | ||
|
b531521da8 | ||
|
11db944a4d | ||
|
9aad202b60 | ||
|
db7ca4b92d | ||
|
be6cce84f0 | ||
|
a5ab85d651 | ||
|
3866262aa5 | ||
|
fb9a9b2085 | ||
|
0c4c6b8b59 | ||
|
ab745072cd | ||
|
3552f447ba | ||
|
a77de6a442 | ||
|
ccb9ca3226 | ||
|
8eadbd39a1 | ||
|
9dbd862451 | ||
|
fda5b3075c | ||
|
55a8183190 | ||
|
6ddc9262ed | ||
|
b39454dc36 | ||
|
73a4fbd453 | ||
|
9eda319ed3 | ||
|
b1ce16963a | ||
|
538f19d0b2 | ||
|
288b91a0cd | ||
|
7ef7084e48 | ||
|
c76180b7d9 | ||
|
04e6220993 | ||
|
2f9d7b32ed | ||
|
99cd79a748 | ||
|
30d25a9151 | ||
|
7d15c4909a | ||
|
297c3f8004 | ||
|
9f79620f9e | ||
|
d2e5fbb4a5 | ||
|
cf3fd9c090 | ||
|
83438a63a4 | ||
|
6c6fe76d11 | ||
|
675e573b54 | ||
|
9071b2d406 | ||
|
8aeb72e215 | ||
|
ff20084ce2 | ||
|
05e56fde67 | ||
|
0ff9b46136 | ||
|
8423028cc5 | ||
|
cdbb3dce14 | ||
|
c5751c06f7 | ||
|
f48fca238e | ||
|
7a591e3da5 | ||
|
76f7e0ee3b | ||
|
2f60d1fd14 | ||
|
5025b5e7b5 | ||
|
c5c359c658 | ||
|
4dd0d5200d | ||
|
d9a7d7ea20 | ||
|
8e57219902 | ||
|
73def89f3b | ||
|
581434287c | ||
|
f93db7f2e8 | ||
|
de6941235d | ||
|
b28b513b74 | ||
|
6f26f26185 | ||
|
aad03052f7 | ||
|
1d1daab582 | ||
|
589efbc3a6 | ||
|
028f6f4f5d | ||
|
b075bd1a8f | ||
|
4b1b190219 | ||
|
eb0e5980d4 | ||
|
4ef5d6366f | ||
|
d1a516a7ed | ||
|
20b99bcaa1 | ||
|
0b787b2da0 | ||
|
cb046658ff | ||
|
2876dcc893 | ||
|
de63808d4b | ||
|
48e920e91d | ||
|
6d5cfd786c | ||
|
33beea77df | ||
|
7fe85067fa | ||
|
00153731d1 | ||
|
d35dc01480 | ||
|
0867f031ff | ||
|
0b74566b74 | ||
|
5f405aadd4 | ||
|
607fa4a02a | ||
|
9b81b9f544 | ||
|
b8c641997e | ||
|
351c90ed86 | ||
|
2a2525d932 | ||
|
a12991b3cd | ||
|
3e87923fc7 | ||
|
39569fd728 | ||
|
3d2a73474f | ||
|
b25456ff7d |
17
.env
17
.env
@ -1,5 +1,14 @@
|
|||||||
# don't forget to add the minus before the version
|
ELASTICSEARCH_VERSION=8.8.0
|
||||||
# example: VERSION=-2.9.0-1
|
IMAGE_REPO=ghcr.io/zammad/zammad
|
||||||
IMAGE_REPO=zammad/zammad-docker-compose
|
MEMCACHE_SERVERS=zammad-memcached:11211
|
||||||
VERSION=
|
MEMCACHE_VERSION=1.6.20-alpine
|
||||||
|
POSTGRES_DB=zammad_production
|
||||||
|
POSTGRES_PASS=zammad
|
||||||
|
POSTGRES_USER=zammad
|
||||||
|
POSTGRES_HOST=zammad-postgresql
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
POSTGRES_VERSION=15.3-alpine
|
||||||
|
REDIS_URL=redis://zammad-redis:6379
|
||||||
|
REDIS_VERSION=7.0.5-alpine
|
||||||
RESTART=always
|
RESTART=always
|
||||||
|
VERSION=6.0.0-66
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
version: '2'
|
---
|
||||||
services:
|
version: "2"
|
||||||
|
|
||||||
|
services:
|
||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
environment:
|
environment:
|
||||||
- VIRTUAL_HOST=helpdesk.domain.tld
|
- VIRTUAL_HOST=helpdesk.domain.tld
|
||||||
|
- NGINX_SERVER_SCHEME=https
|
||||||
networks:
|
networks:
|
||||||
- default
|
- default
|
||||||
- proxy_2_zammad
|
- proxy_2_zammad
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
|
---
|
||||||
version: '2'
|
version: '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
image: jwilder/nginx-proxy:alpine
|
image: jwilder/nginx-proxy:alpine
|
||||||
@ -10,7 +12,7 @@ services:
|
|||||||
- ./certs:/etc/nginx/certs
|
- ./certs:/etc/nginx/certs
|
||||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||||
networks:
|
networks:
|
||||||
- 2_apps
|
- 2_apps
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
2_apps:
|
2_apps:
|
||||||
|
11
.github/ISSUE_TEMPLATE.md
vendored
11
.github/ISSUE_TEMPLATE.md
vendored
@ -8,23 +8,20 @@ Hi there - thanks for filling an issue. Please ensure the following things befor
|
|||||||
* The upper textblock will be removed automatically when you submit your issue *
|
* The upper textblock will be removed automatically when you submit your issue *
|
||||||
-->
|
-->
|
||||||
|
|
||||||
### Infos:
|
# Infos
|
||||||
|
|
||||||
* Docker version:
|
* Docker version:
|
||||||
* Docker-compose version:
|
* Docker-compose version:
|
||||||
* Operating system (Docker host):
|
* Operating system (Docker host):
|
||||||
|
|
||||||
|
# Expected behavior
|
||||||
### Expected behavior:
|
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
|
# Actual behavior
|
||||||
### Actual behavior:
|
|
||||||
|
|
||||||
*
|
*
|
||||||
|
|
||||||
|
# Steps to reproduce the behavior
|
||||||
### Steps to reproduce the behavior:
|
|
||||||
|
|
||||||
*
|
*
|
||||||
|
31
.github/auto_wizard.json
vendored
Normal file
31
.github/auto_wizard.json
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"Token": "docker_compose_token",
|
||||||
|
"TextModuleLocale": {
|
||||||
|
"Locale": "en-us"
|
||||||
|
},
|
||||||
|
"Users": [
|
||||||
|
{
|
||||||
|
"login": "info@zammad.org",
|
||||||
|
"firstname": "Zam",
|
||||||
|
"lastname": "Mad",
|
||||||
|
"email": "info@zammad.org",
|
||||||
|
"organization": "Zammad",
|
||||||
|
"password": "Zammad"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Settings": [
|
||||||
|
{
|
||||||
|
"name": "product_name",
|
||||||
|
"value": "Zammad Service Desk"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "system_online_service",
|
||||||
|
"value": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"Organizations": [
|
||||||
|
{
|
||||||
|
"name": "Zammad"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
16
.github/dependabot.yml
vendored
Normal file
16
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "docker"
|
||||||
|
directory: "/containers/zammad"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
time: "09:00"
|
||||||
|
timezone: "Europe/Berlin"
|
||||||
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
time: "09:00"
|
||||||
|
timezone: "Europe/Berlin"
|
3
.github/linters/.markdown-lint.yml
vendored
Normal file
3
.github/linters/.markdown-lint.yml
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
MD013:
|
||||||
|
line_length: 600
|
37
.github/release-drafter.yml
vendored
Normal file
37
.github/release-drafter.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
name-template: "v$RESOLVED_VERSION"
|
||||||
|
tag-template: "v$RESOLVED_VERSION"
|
||||||
|
categories:
|
||||||
|
- title: "🚀 Features"
|
||||||
|
labels:
|
||||||
|
- "feature"
|
||||||
|
- "enhancement"
|
||||||
|
- title: "🐛 Bug Fixes"
|
||||||
|
labels:
|
||||||
|
- "fix"
|
||||||
|
- "bugfix"
|
||||||
|
- "bug"
|
||||||
|
- title: "🧹 Maintenance"
|
||||||
|
labels:
|
||||||
|
- "chore"
|
||||||
|
- "dependencies"
|
||||||
|
version-resolver:
|
||||||
|
major:
|
||||||
|
labels:
|
||||||
|
- "feature"
|
||||||
|
minor:
|
||||||
|
labels:
|
||||||
|
- "enhancement"
|
||||||
|
patch:
|
||||||
|
labels:
|
||||||
|
- "fix"
|
||||||
|
- "bugfix"
|
||||||
|
- "bug"
|
||||||
|
- "chore"
|
||||||
|
- "dependencies"
|
||||||
|
default: patch
|
||||||
|
template: |
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
$CHANGES
|
||||||
|
|
||||||
|
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
|
18
.github/stale.yml
vendored
Normal file
18
.github/stale.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 60
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 7
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- pinned
|
||||||
|
- security
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: wontfix
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
51
.github/tests.sh
vendored
Executable file
51
.github/tests.sh
vendored
Executable file
@ -0,0 +1,51 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# run zammad tests
|
||||||
|
#
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
docker-compose logs --timestamps --follow &
|
||||||
|
|
||||||
|
until (curl -I --silent --fail localhost:8080 | grep -iq "HTTP/1.1 200 OK"); do
|
||||||
|
echo "wait for zammad to be ready..."
|
||||||
|
sleep 15
|
||||||
|
done
|
||||||
|
|
||||||
|
sleep 30
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Success - Zammad is up :)"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Execute autowizard..."
|
||||||
|
echo
|
||||||
|
|
||||||
|
docker exec --env=AUTOWIZARD_RELATIVE_PATH=var/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Autowizard executed successful :)"
|
||||||
|
echo
|
||||||
|
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Check DB for AutoWizard user"
|
||||||
|
echo
|
||||||
|
|
||||||
|
docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rails r "p User.find_by(email: 'info@zammad.org')" | grep 'info@zammad.org'
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Check DB for AutoWizard user successfull :)"
|
||||||
|
echo
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "Fill DB with some random data"
|
||||||
|
echo
|
||||||
|
|
||||||
|
docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)"
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "DB fill successful :)"
|
||||||
|
echo
|
25
.github/workflows/ci-remote-image.yaml
vendored
Normal file
25
.github/workflows/ci-remote-image.yaml
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: ci-remote-image
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run-remote-image-docker-compose:
|
||||||
|
timeout-minutes: 20
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: pull docker-compose images
|
||||||
|
run: docker-compose pull
|
||||||
|
|
||||||
|
- name: run docker-compose up
|
||||||
|
run: docker-compose up --detach
|
||||||
|
|
||||||
|
- name: add autowizard file
|
||||||
|
run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad/var
|
||||||
|
|
||||||
|
- name: run tests
|
||||||
|
run: .github/tests.sh
|
32
.github/workflows/ci.yaml
vendored
Normal file
32
.github/workflows/ci.yaml
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint-docker-compose-file:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: lint zammad docker-compose file
|
||||||
|
run: docker-compose config
|
||||||
|
|
||||||
|
super-linter:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Lint Code Base
|
||||||
|
uses: github/super-linter/slim@v5
|
||||||
|
env:
|
||||||
|
DEFAULT_BRANCH: master
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
LINTER_RULES_PATH: .github/linters
|
||||||
|
VALIDATE_ALL_CODEBASE: false
|
||||||
|
VALIDATE_JSCPD: false
|
22
.github/workflows/release-drafter.yaml
vendored
Normal file
22
.github/workflows/release-drafter.yaml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Release Drafter
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
types: [opened, reopened, synchronize]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update_release_draft:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: release-drafter/release-drafter@v5
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
13
.travis.yml
13
.travis.yml
@ -1,13 +0,0 @@
|
|||||||
dist: xenial
|
|
||||||
sudo: required
|
|
||||||
group: deprecated
|
|
||||||
services:
|
|
||||||
- docker
|
|
||||||
before_install:
|
|
||||||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
|
||||||
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
|
|
||||||
- sudo apt-get update
|
|
||||||
- sudo apt-get -o Dpkg::Options::="--force-confnew" -y install docker-ce
|
|
||||||
- echo "${DOCKER_PASSWORD}" | docker login -u="${DOCKER_USERNAME}" --password-stdin
|
|
||||||
install: true
|
|
||||||
script: hooks/build
|
|
13
Dockerfile
13
Dockerfile
@ -1,13 +0,0 @@
|
|||||||
MAINTAINER Zammad <info@zammad.org>
|
|
||||||
ARG BUILD_DATE
|
|
||||||
|
|
||||||
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 - Dummy Dockerfile for DockerHub autobuilds" \
|
|
||||||
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"
|
|
40
README.md
40
README.md
@ -2,41 +2,51 @@
|
|||||||
|
|
||||||
Zammad is a web based open source helpdesk/ticket system with many features
|
Zammad is a web based open source helpdesk/ticket system with many features
|
||||||
to manage customer communication via several channels like telephone, facebook,
|
to manage customer communication via several channels like telephone, facebook,
|
||||||
twitter, chat and e-mails. It is distributed under the GNU AFFERO General Public
|
twitter, chat and emails. It is distributed under the GNU AFFERO General Public
|
||||||
License (AGPL). Do you receive many e-mails and want to answer them with a team of agents?
|
License (AGPL). Do you receive many emails and want to answer them with a team of agents?
|
||||||
You're going to love Zammad!
|
You're going to love Zammad!
|
||||||
|
|
||||||
|
## Use cases
|
||||||
|
|
||||||
## What is zammad-docker-compose repo for?
|
This repository is the starting point if you want to:
|
||||||
|
|
||||||
This repo is meant to be the starting point for somebody who likes to use dockerized multi-container Zammad in production.
|
- deploy Zammad in a containerized production environment
|
||||||
|
- test the current `stable` or `develop` versions of Zammad
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
## Getting started with zammad-docker-compose
|
[Learn more on Zammad’s documentation](https://docs.zammad.org/en/latest/install/docker-compose.html)
|
||||||
|
|
||||||
https://docs.zammad.org/en/latest/install-docker-compose.html
|
## Upgrading
|
||||||
|
|
||||||
|
For upgrading instructions see our [Releases](https://github.com/zammad/zammad-docker-compose/releases).
|
||||||
|
|
||||||
## Build Status
|
## Status
|
||||||
|
|
||||||
[](https://travis-ci.org/zammad/zammad-docker-compose)
|
|
||||||
|
|
||||||
|
[](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml) [](https://hub.docker.com/r/zammad/zammad-docker-compose/)
|
||||||
|
|
||||||
## Using a reverse proxy
|
## Using a reverse proxy
|
||||||
|
|
||||||
In environments with more then one web applications it is necessary to use a reverse proxy to route connections to port 80 and 443 to the right application.
|
In environments with more then one web applications it is necessary to use a reverse proxy to route connections to port 80 and 443 to the right application.
|
||||||
To run Zammad behind a revers proxy, we provide `docker-compose.proxy-example.yml` as a starting point.
|
To run Zammad behind a reverse proxy, we provide `docker-compose.proxy-example.yml` as a starting point.
|
||||||
|
|
||||||
1. Copy `./.examples/proxy/docker-compose.proxy-example.yml` to your own configuration, e.g. `./docker-compose.prod.yml`
|
1. Copy `./.examples/proxy/docker-compose.proxy-example.yml` to your own configuration, e.g. `./docker-compose.prod.yml`
|
||||||
`cp ./.examples/proxy/docker-compose.proxy-example.yml ./docker-compose.prod.yml`
|
`cp ./.examples/proxy/docker-compose.proxy-example.yml ./docker-compose.prod.yml`
|
||||||
1. Modify the environment variable `VIRTUAL_HOST` and the name of the external network in `./docker-compose.prod.yml` to fit your environment.
|
2. Modify the environment variable `VIRTUAL_HOST` and the name of the external network in `./docker-compose.prod.yml` to fit your environment.
|
||||||
1. Run docker-composer commands with the default and your configuration, e.g. `docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d`
|
3. Run docker-composer commands with the default and your configuration, e.g. `docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d`
|
||||||
|
|
||||||
See `.examples/proxy/docker-compose.yml` for an example proxy project.
|
See `.examples/proxy/docker-compose.yml` for an example proxy project.
|
||||||
|
|
||||||
Like this, you can add your `docker-compose.prod.yml` to a branch of your Git repository and stay up to date by merging changes to your branch.
|
Like this, you can add your `docker-compose.prod.yml` to a branch of your Git repository and stay up to date by merging changes to your branch.
|
||||||
|
|
||||||
|
|
||||||
## Using Rancher
|
## Using Rancher
|
||||||
|
|
||||||
* RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up
|
```console
|
||||||
|
RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up
|
||||||
|
```
|
||||||
|
|
||||||
|
## Running without Elasticsearch
|
||||||
|
|
||||||
|
Elasticsearch is an optional, but strongly recommended dependency for Zammad. More details can be found in the [documentation](https://docs.zammad.org/en/latest/prerequisites/software.html#elasticsearch-optional). There are however certain scenarios when running without Elasticsearch may be desired, e.g. for very small teams, for teams with limited budget or as a temporary solution for an unplanned Elasticsearch downtime or planned cluster upgrade.
|
||||||
|
|
||||||
|
Elasticsearch is enabled by default in the example `docker-compose.yml` file. It is also by default required to run the "zammad-init" command. Disabling Elasticsearch is possible by setting a special environment variable: `ELASTICSEARCH_ENABLED=false` for the `zammad-init` container and removing all references to Elasticsearch everywhere else: the `zammad-elasticsearch` container, its volume and links to it.
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
FROM docker.elastic.co/elasticsearch/elasticsearch:7.6.0
|
|
||||||
MAINTAINER Zammad <info@zammad.org>
|
|
||||||
ARG BUILD_DATE
|
|
||||||
|
|
||||||
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 - Elasticsearch" \
|
|
||||||
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"
|
|
||||||
|
|
||||||
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack --purge && \
|
|
||||||
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,23 +0,0 @@
|
|||||||
FROM postgres:9.6-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" \
|
|
||||||
org.label-schema.description="Docker container for Zammad - Postgresql" \
|
|
||||||
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"
|
|
||||||
|
|
||||||
# copy backup script
|
|
||||||
COPY containers/zammad-postgresql/backup.sh /usr/local/bin/
|
|
||||||
RUN chmod +x /usr/local/bin/backup.sh
|
|
@ -1,63 +0,0 @@
|
|||||||
FROM ruby:2.5.5-slim AS builder
|
|
||||||
# note: zammad is currently incompatible to alpine because of:
|
|
||||||
# https://github.com/docker-library/ruby/issues/113
|
|
||||||
|
|
||||||
MAINTAINER Zammad <info@zammad.org>
|
|
||||||
ARG BUILD_DATE
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
ENV GIT_BRANCH stable
|
|
||||||
ENV GIT_URL ${PROJECT_URL}.git
|
|
||||||
ENV GOSU_VERSION 1.11
|
|
||||||
ENV PROJECT_URL https://github.com/zammad/zammad
|
|
||||||
ENV RAILS_ENV production
|
|
||||||
ENV TAR_GZ_URL ${PROJECT_URL}/archive/${GIT_BRANCH}.tar.gz
|
|
||||||
ENV ZAMMAD_DIR /opt/zammad
|
|
||||||
ENV ZAMMAD_READY_FILE ${ZAMMAD_DIR}/tmp/zammad.ready
|
|
||||||
ENV ZAMMAD_TMP_DIR /tmp/zammad-${GIT_BRANCH}
|
|
||||||
ENV ZAMMAD_USER zammad
|
|
||||||
|
|
||||||
# install zammad
|
|
||||||
COPY containers/zammad/setup.sh /tmp
|
|
||||||
RUN chmod +x /tmp/setup.sh; \
|
|
||||||
/tmp/setup.sh install
|
|
||||||
|
|
||||||
|
|
||||||
FROM ruby:2.5.5-slim
|
|
||||||
|
|
||||||
MAINTAINER Zammad <info@zammad.org>
|
|
||||||
ARG BUILD_DATE
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
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 - Data 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"
|
|
||||||
|
|
||||||
ENV GIT_BRANCH stable
|
|
||||||
ENV RAILS_ENV production
|
|
||||||
ENV ZAMMAD_DIR /opt/zammad
|
|
||||||
ENV ZAMMAD_READY_FILE ${ZAMMAD_DIR}/tmp/zammad.ready
|
|
||||||
ENV ZAMMAD_TMP_DIR /tmp/zammad-${GIT_BRANCH}
|
|
||||||
ENV ZAMMAD_USER zammad
|
|
||||||
|
|
||||||
COPY containers/zammad/setup.sh /tmp
|
|
||||||
RUN chmod +x /tmp/setup.sh; \
|
|
||||||
/tmp/setup.sh run
|
|
||||||
|
|
||||||
COPY --from=builder ${ZAMMAD_TMP_DIR} ${ZAMMAD_TMP_DIR}
|
|
||||||
COPY --from=builder /usr/local/bin/gosu /usr/local/bin/gosu
|
|
||||||
COPY --from=builder /usr/local/bundle /usr/local/bundle
|
|
||||||
|
|
||||||
# docker init
|
|
||||||
COPY containers/zammad/docker-entrypoint.sh /
|
|
||||||
RUN chmod +x /docker-entrypoint.sh
|
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
||||||
|
|
||||||
WORKDIR ${ZAMMAD_DIR}
|
|
@ -1,165 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
: "${AUTOWIZARD_JSON:=''}"
|
|
||||||
: "${ELASTICSEARCH_HOST:=zammad-elasticsearch}"
|
|
||||||
: "${ELASTICSEARCH_PORT:=9200}"
|
|
||||||
: "${ELASTICSEARCH_SCHEMA:=http}"
|
|
||||||
: "${ELASTICSEARCH_SSL_VERIFY:=true}"
|
|
||||||
: "${MEMCACHED_HOST:=zammad-memcached}"
|
|
||||||
: "${MEMCACHED_PORT:=11211}"
|
|
||||||
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
|
||||||
: "${POSTGRESQL_PORT:=5432}"
|
|
||||||
: "${POSTGRESQL_USER:=postgres}"
|
|
||||||
: "${POSTGRESQL_PASS:=}"
|
|
||||||
: "${POSTGRESQL_DB:=zammad_production}"
|
|
||||||
: "${POSTGRESQL_DB_CREATE:=true}"
|
|
||||||
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
|
|
||||||
: "${ZAMMAD_RAILSSERVER_PORT:=3000}"
|
|
||||||
: "${ZAMMAD_WEBSOCKET_HOST:=zammad-websocket}"
|
|
||||||
: "${ZAMMAD_WEBSOCKET_PORT:=6042}"
|
|
||||||
: "${NGINX_SERVER_NAME:=_}"
|
|
||||||
|
|
||||||
function check_zammad_ready {
|
|
||||||
sleep 15
|
|
||||||
until [ -f "${ZAMMAD_READY_FILE}" ]; do
|
|
||||||
echo "waiting for init container to finish install or update..."
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# zammad init
|
|
||||||
if [ "$1" = 'zammad-init' ]; then
|
|
||||||
# install / update zammad
|
|
||||||
test -f "${ZAMMAD_READY_FILE}" && rm "${ZAMMAD_READY_FILE}"
|
|
||||||
rsync -a --delete --exclude 'public/assets/images/*' --exclude 'storage/fs/*' "${ZAMMAD_TMP_DIR}/" "${ZAMMAD_DIR}"
|
|
||||||
rsync -a "${ZAMMAD_TMP_DIR}"/public/assets/images/ "${ZAMMAD_DIR}"/public/assets/images
|
|
||||||
|
|
||||||
until (echo > /dev/tcp/"${POSTGRESQL_HOST}"/"${POSTGRESQL_PORT}") &> /dev/null; do
|
|
||||||
echo "zammad railsserver waiting for postgresql server to be ready..."
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
cd "${ZAMMAD_DIR}"
|
|
||||||
|
|
||||||
# configure database
|
|
||||||
sed -e "s#.*adapter:.*# adapter: postgresql#g" -e "s#.*database:.*# database: ${POSTGRESQL_DB}#g" -e "s#.*username:.*# username: ${POSTGRESQL_USER}#g" -e "s#.*password:.*# password: ${POSTGRESQL_PASS}\\n host: ${POSTGRESQL_HOST}\\n port: ${POSTGRESQL_PORT}#g" < contrib/packager.io/database.yml.pkgr > config/database.yml
|
|
||||||
|
|
||||||
# configure memcache
|
|
||||||
sed -i -e "s/.*config.cache_store.*file_store.*cache_file_store.*/ config.cache_store = :dalli_store, '${MEMCACHED_HOST}:${MEMCACHED_PORT}'\\n config.session_store = :dalli_store, '${MEMCACHED_HOST}:${MEMCACHED_PORT}'/" config/application.rb
|
|
||||||
|
|
||||||
echo "initialising / updating database..."
|
|
||||||
|
|
||||||
# check if database exists / update to new version
|
|
||||||
set +e
|
|
||||||
bundle exec rake db:migrate &> /dev/null
|
|
||||||
DB_MIGRATE="$?"
|
|
||||||
|
|
||||||
# check if database is populated
|
|
||||||
if [ "${DB_MIGRATE}" == "0" ]; then
|
|
||||||
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')" &> /dev/null
|
|
||||||
DB_SETTINGS="$?"
|
|
||||||
fi
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# create database if not exists
|
|
||||||
if [ "${DB_MIGRATE}" != "0" ] && [ "${POSTGRESQL_DB_CREATE}" == "true" ]; then
|
|
||||||
echo "creating database..."
|
|
||||||
bundle exec rake db:create
|
|
||||||
fi
|
|
||||||
|
|
||||||
# populate database and create autowizard.json on first install
|
|
||||||
if [ "${DB_SETTINGS}" != "0" ]; then
|
|
||||||
echo "seeding database..."
|
|
||||||
bundle exec rake db:seed
|
|
||||||
|
|
||||||
if [ -n "${AUTOWIZARD_JSON}" ]; then
|
|
||||||
echo "${AUTOWIZARD_JSON}" | base64 -d > auto_wizard.json
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# es config
|
|
||||||
echo "changing settings..."
|
|
||||||
bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')"
|
|
||||||
|
|
||||||
if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then
|
|
||||||
bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")"
|
|
||||||
bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
until (echo > /dev/tcp/${ELASTICSEARCH_HOST}/${ELASTICSEARCH_PORT}) &> /dev/null; do
|
|
||||||
echo "zammad railsserver waiting for elasticsearch server to be ready..."
|
|
||||||
sleep 5
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ "${ELASTICSEARCH_SSL_VERIFY}" == "false" ]; then
|
|
||||||
SSL_SKIP_VERIFY="-k"
|
|
||||||
else
|
|
||||||
SSL_SKIP_VERIFY=""
|
|
||||||
fi
|
|
||||||
if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then
|
|
||||||
echo "rebuilding es searchindex..."
|
|
||||||
bundle exec rake searchindex:rebuild
|
|
||||||
fi
|
|
||||||
|
|
||||||
# chown everything to zammad user
|
|
||||||
chown -R "${ZAMMAD_USER}":"${ZAMMAD_USER}" "${ZAMMAD_DIR}"
|
|
||||||
|
|
||||||
# create install ready file
|
|
||||||
su -c "echo 'zammad-init' > ${ZAMMAD_READY_FILE}" "${ZAMMAD_USER}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# zammad nginx
|
|
||||||
if [ "$1" = 'zammad-nginx' ]; then
|
|
||||||
check_zammad_ready
|
|
||||||
|
|
||||||
# configure nginx
|
|
||||||
if ! env | grep -q KUBERNETES; then
|
|
||||||
sed -e "s#server .*:3000#server ${ZAMMAD_RAILSSERVER_HOST}:${ZAMMAD_RAILSSERVER_PORT}#g" -e "s#server .*:6042#server ${ZAMMAD_WEBSOCKET_HOST}:${ZAMMAD_WEBSOCKET_PORT}#g" -e "s#server_name .*#server_name ${NGINX_SERVER_NAME};#g" -e 's#/var/log/nginx/zammad.\(access\|error\).log#/dev/stdout#g' < contrib/nginx/zammad.conf > /etc/nginx/sites-enabled/default
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "starting nginx..."
|
|
||||||
|
|
||||||
exec /usr/sbin/nginx -g 'daemon off;'
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# zammad-railsserver
|
|
||||||
if [ "$1" = 'zammad-railsserver' ]; then
|
|
||||||
test -f /opt/zammad/tmp/pids/server.pid && rm /opt/zammad/tmp/pids/server.pid
|
|
||||||
|
|
||||||
check_zammad_ready
|
|
||||||
|
|
||||||
cd "${ZAMMAD_DIR}"
|
|
||||||
|
|
||||||
echo "starting railsserver..."
|
|
||||||
|
|
||||||
#shellcheck disable=SC2101
|
|
||||||
exec gosu "${ZAMMAD_USER}":"${ZAMMAD_USER}" bundle exec rails server puma -b [::] -p "${ZAMMAD_RAILSSERVER_PORT}" -e "${RAILS_ENV}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# zammad-scheduler
|
|
||||||
if [ "$1" = 'zammad-scheduler' ]; then
|
|
||||||
check_zammad_ready
|
|
||||||
|
|
||||||
cd "${ZAMMAD_DIR}"
|
|
||||||
|
|
||||||
echo "starting scheduler..."
|
|
||||||
|
|
||||||
exec gosu "${ZAMMAD_USER}":"${ZAMMAD_USER}" bundle exec script/scheduler.rb run
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# zammad-websocket
|
|
||||||
if [ "$1" = 'zammad-websocket' ]; then
|
|
||||||
check_zammad_ready
|
|
||||||
|
|
||||||
cd "${ZAMMAD_DIR}"
|
|
||||||
|
|
||||||
echo "starting websocket server..."
|
|
||||||
|
|
||||||
exec gosu "${ZAMMAD_USER}":"${ZAMMAD_USER}" bundle exec script/websocket-server.rb -b 0.0.0.0 -p "${ZAMMAD_WEBSOCKET_PORT}" start
|
|
||||||
fi
|
|
@ -1,43 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# install dependencies
|
|
||||||
if [ "$1" = 'install' ]; then
|
|
||||||
PACKAGES="build-essential curl git libimlib2-dev libpq-dev"
|
|
||||||
elif [ "$1" = 'run' ]; then
|
|
||||||
PACKAGES="curl libimlib2 libpq5 nginx rsync"
|
|
||||||
fi
|
|
||||||
|
|
||||||
apt-get update
|
|
||||||
apt-get upgrade -y
|
|
||||||
apt-get install -y --no-install-recommends ${PACKAGES}
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
# install gosu
|
|
||||||
if [ "$1" = 'install' ]; then
|
|
||||||
curl -s -J -L -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture)"
|
|
||||||
chmod +x /usr/local/bin/gosu
|
|
||||||
gosu nobody true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install zammad
|
|
||||||
groupadd -g 1000 "${ZAMMAD_USER}"
|
|
||||||
useradd -M -d "${ZAMMAD_DIR}" -s /bin/bash -u 1000 -g 1000 "${ZAMMAD_USER}"
|
|
||||||
|
|
||||||
if [ "$1" = 'install' ]; then
|
|
||||||
cd "$(dirname "${ZAMMAD_TMP_DIR}")"
|
|
||||||
curl -s -J -L -O "${TAR_GZ_URL}"
|
|
||||||
tar -xzf zammad-"${GIT_BRANCH}".tar.gz
|
|
||||||
rm zammad-"${GIT_BRANCH}".tar.gz
|
|
||||||
cd "${ZAMMAD_TMP_DIR}"
|
|
||||||
bundle install --without test development mysql
|
|
||||||
contrib/packager.io/fetch_locales.rb
|
|
||||||
sed -e 's#.*adapter: postgresql# adapter: nulldb#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: zammad-postgresql\n#g' < contrib/packager.io/database.yml.pkgr > config/database.yml
|
|
||||||
sed -i "/require 'rails\/all'/a require\ 'nulldb'" config/application.rb
|
|
||||||
sed -i '/# Use a different logger for distributed setups./a \ \ config.logger = Logger.new(STDOUT)' config/environments/production.rb
|
|
||||||
sed -i 's/.*scheduler_\(err\|out\).log.*//g' script/scheduler.rb
|
|
||||||
touch db/schema.rb
|
|
||||||
bundle exec rake assets:precompile
|
|
||||||
rm -r tmp/cache
|
|
||||||
chown -R "${ZAMMAD_USER}":"${ZAMMAD_USER}" "${ZAMMAD_TMP_DIR}"
|
|
||||||
fi
|
|
19
docker-compose.override-local.yml
Normal file
19
docker-compose.override-local.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
version: '3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
zammad-init:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-nginx:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-railsserver:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-scheduler:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-websocket:
|
||||||
|
image: zammad-local
|
@ -1,6 +1,8 @@
|
|||||||
version: '2'
|
---
|
||||||
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "8080:8080"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
version: '2'
|
---
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
@ -6,54 +7,65 @@ services:
|
|||||||
command: ["zammad-backup"]
|
command: ["zammad-backup"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
entrypoint: /usr/local/bin/backup.sh
|
|
||||||
image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
|
|
||||||
links:
|
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
|
entrypoint: /usr/local/bin/backup.sh
|
||||||
|
environment:
|
||||||
|
- BACKUP_TIME=03:00
|
||||||
|
- HOLD_DAYS=10
|
||||||
|
- POSTGRESQL_DB=${POSTGRES_DB}
|
||||||
|
- POSTGRESQL_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRESQL_PASSWORD=${POSTGRES_PASS}
|
||||||
|
- TZ=Europe/Berlin
|
||||||
|
image: postgres:${POSTGRES_VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-backup:/var/tmp/zammad
|
- zammad-backup:/var/tmp/zammad
|
||||||
- zammad-data:/opt/zammad
|
- zammad-var:/opt/zammad/var:ro
|
||||||
|
- ./scripts/backup.sh:/usr/local/bin/backup.sh:ro
|
||||||
|
|
||||||
zammad-elasticsearch:
|
zammad-elasticsearch:
|
||||||
image: ${IMAGE_REPO}:zammad-elasticsearch${VERSION}
|
image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
- elasticsearch-data:/bitnami/elasticsearch/data
|
||||||
|
|
||||||
zammad-init:
|
zammad-init:
|
||||||
command: ["zammad-init"]
|
command: ["zammad-init"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
image: ${IMAGE_REPO}:zammad${VERSION}
|
environment:
|
||||||
links:
|
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
|
||||||
- zammad-elasticsearch
|
- REDIS_URL=${REDIS_URL}
|
||||||
- zammad-postgresql
|
image: ${IMAGE_REPO}:${VERSION}
|
||||||
restart: on-failure
|
restart: on-failure
|
||||||
|
user: 0:0
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-data:/opt/zammad
|
- zammad-config-nginx:/etc/nginx/sites-enabled
|
||||||
|
- zammad-var:/opt/zammad/var
|
||||||
|
|
||||||
zammad-memcached:
|
zammad-memcached:
|
||||||
command: ["zammad-memcached"]
|
command: memcached -m 256M
|
||||||
image: ${IMAGE_REPO}:zammad-memcached${VERSION}
|
image: memcached:${MEMCACHE_VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
|
|
||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
command: ["zammad-nginx"]
|
command: ["zammad-nginx"]
|
||||||
|
expose:
|
||||||
|
- "8080"
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: ${IMAGE_REPO}:zammad${VERSION}
|
image: ${IMAGE_REPO}:${VERSION}
|
||||||
links:
|
|
||||||
- zammad-railsserver
|
|
||||||
- zammad-websocket
|
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-data:/opt/zammad
|
- zammad-config-nginx:/etc/nginx/sites-enabled:ro
|
||||||
expose:
|
- zammad-var:/opt/zammad/var:ro
|
||||||
- "80"
|
|
||||||
|
|
||||||
zammad-postgresql:
|
zammad-postgresql:
|
||||||
image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
|
environment:
|
||||||
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${POSTGRES_PASS}
|
||||||
|
image: postgres:${POSTGRES_VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- postgresql-data:/var/lib/postgresql/data
|
- postgresql-data:/var/lib/postgresql/data
|
||||||
@ -63,48 +75,59 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- zammad-memcached
|
- zammad-memcached
|
||||||
- zammad-postgresql
|
- zammad-postgresql
|
||||||
image: ${IMAGE_REPO}:zammad${VERSION}
|
- zammad-redis
|
||||||
links:
|
environment:
|
||||||
- zammad-elasticsearch
|
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
|
||||||
- zammad-memcached
|
- REDIS_URL=${REDIS_URL}
|
||||||
- zammad-postgresql
|
image: ${IMAGE_REPO}:${VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-data:/opt/zammad
|
- zammad-var:/opt/zammad/var
|
||||||
|
|
||||||
|
zammad-redis:
|
||||||
|
image: redis:${REDIS_VERSION}
|
||||||
|
restart: ${RESTART}
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
|
||||||
zammad-scheduler:
|
zammad-scheduler:
|
||||||
command: ["zammad-scheduler"]
|
command: ["zammad-scheduler"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-memcached
|
- zammad-memcached
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: ${IMAGE_REPO}:zammad${VERSION}
|
- zammad-redis
|
||||||
links:
|
environment:
|
||||||
- zammad-elasticsearch
|
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
|
||||||
- zammad-memcached
|
- REDIS_URL=${REDIS_URL}
|
||||||
- zammad-postgresql
|
image: ${IMAGE_REPO}:${VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-data:/opt/zammad
|
- zammad-var:/opt/zammad/var
|
||||||
|
|
||||||
zammad-websocket:
|
zammad-websocket:
|
||||||
command: ["zammad-websocket"]
|
command: ["zammad-websocket"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-memcached
|
- zammad-memcached
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: ${IMAGE_REPO}:zammad${VERSION}
|
- zammad-redis
|
||||||
links:
|
environment:
|
||||||
- zammad-postgresql
|
- MEMCACHE_SERVERS=${MEMCACHE_SERVERS}
|
||||||
- zammad-memcached
|
- REDIS_URL=${REDIS_URL}
|
||||||
|
image: ${IMAGE_REPO}:${VERSION}
|
||||||
restart: ${RESTART}
|
restart: ${RESTART}
|
||||||
volumes:
|
volumes:
|
||||||
- zammad-data:/opt/zammad
|
- zammad-var:/opt/zammad/var
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
elasticsearch-data:
|
elasticsearch-data:
|
||||||
driver: local
|
driver: local
|
||||||
postgresql-data:
|
postgresql-data:
|
||||||
driver: local
|
driver: local
|
||||||
|
redis-data:
|
||||||
|
driver: local
|
||||||
zammad-backup:
|
zammad-backup:
|
||||||
driver: local
|
driver: local
|
||||||
zammad-data:
|
zammad-config-nginx:
|
||||||
|
driver: local
|
||||||
|
zammad-var:
|
||||||
driver: local
|
driver: local
|
||||||
|
37
hooks/build
37
hooks/build
@ -1,37 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# build hook for dockerhubs autobuild feature
|
|
||||||
#
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
. "hooks/config"
|
|
||||||
|
|
||||||
#shellcheck disable=SC2153
|
|
||||||
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do
|
|
||||||
if [ "${TRAVIS}" == 'true' ] || [ "${CIRCLECI}" == 'true' ]; then
|
|
||||||
|
|
||||||
if [ -n "${ZAMMAD_VERSION}" ]; then
|
|
||||||
DOCKER_TAG="-t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}"
|
|
||||||
else
|
|
||||||
ZAMMAD_VERSION="latest"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Build Zammad Docker image ${DOCKER_IMAGE} with version ${ZAMMAD_VERSION} for DockerHubs ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} repo"
|
|
||||||
|
|
||||||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE} -t ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest ${DOCKER_TAG} -f containers/${DOCKER_IMAGE}/Dockerfile .
|
|
||||||
|
|
||||||
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}
|
|
||||||
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-latest
|
|
||||||
|
|
||||||
if [ "${ZAMMAD_VERSION}" != "latest" ]; then
|
|
||||||
docker push ${DOCKER_REGISTRY}/${GITHUB_USERNAME}/${DOCKER_REPOSITORY}:${DOCKER_IMAGE}-${ZAMMAD_VERSION}
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "Build Zammad Docker image ${DOCKER_IMAGE} for DockerHubs ${DOCKER_REPO}:${DOCKER_IMAGE} repo"
|
|
||||||
|
|
||||||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_REPO}:${DOCKER_IMAGE}" -f containers/"${DOCKER_IMAGE}"/Dockerfile .
|
|
||||||
|
|
||||||
docker push ${DOCKER_REPO}:${DOCKER_IMAGE}
|
|
||||||
fi
|
|
||||||
done
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# build hooks config
|
|
||||||
#
|
|
||||||
|
|
||||||
DOCKER_IMAGES="zammad zammad-elasticsearch zammad-memcached zammad-postgresql"
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
#
|
|
||||||
# build hook for dockerhubs autobuild feature
|
|
||||||
#
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
version: '2'
|
version: '2'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
20
containers/zammad-postgresql/backup.sh → scripts/backup.sh
Normal file → Executable file
20
containers/zammad-postgresql/backup.sh → scripts/backup.sh
Normal file → Executable file
@ -2,15 +2,16 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
: "${ZAMMAD_DIR:=/opt/zammad/var}"
|
||||||
|
: "${BACKUP_DIR:=/var/tmp/zammad}"
|
||||||
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
|
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
|
||||||
: "${ZAMMAD_RAILSSERVER_PORT:=3000}"
|
: "${ZAMMAD_RAILSSERVER_PORT:=3000}"
|
||||||
: "${POSTGRESQL_USER:=postgres}"
|
|
||||||
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
||||||
: "${POSTGRESQL_PORT:=5432}"
|
: "${POSTGRESQL_PORT:=5432}"
|
||||||
: "${POSTGRESQL_DB:=zammad_production}"
|
: "${POSTGRESQL_DB:=zammad_production}"
|
||||||
|
|
||||||
function check_railsserver_available {
|
function check_railsserver_available {
|
||||||
until (echo > /dev/tcp/${ZAMMAD_RAILSSERVER_HOST}/${ZAMMAD_RAILSSERVER_PORT}) &> /dev/null; do
|
until (echo > "/dev/tcp/$ZAMMAD_RAILSSERVER_HOST/$ZAMMAD_RAILSSERVER_PORT") &> /dev/null; do
|
||||||
echo "waiting for railsserver to be ready..."
|
echo "waiting for railsserver to be ready..."
|
||||||
sleep 60
|
sleep 60
|
||||||
done
|
done
|
||||||
@ -23,7 +24,7 @@ function zammad_backup {
|
|||||||
|
|
||||||
# delete old backups
|
# delete old backups
|
||||||
if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls "${BACKUP_DIR}")" ]; then
|
if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls "${BACKUP_DIR}")" ]; then
|
||||||
find "${BACKUP_DIR}"/*_zammad_*.gz -type f -mtime +"${HOLD_DAYS}" -exec rm {} \;
|
find "${BACKUP_DIR}"/*_zammad_*.gz -type f -mtime +"${HOLD_DAYS}" -delete
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${NO_FILE_BACKUP}" != "yes" ]; then
|
if [ "${NO_FILE_BACKUP}" != "yes" ]; then
|
||||||
@ -32,7 +33,9 @@ function zammad_backup {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#db backup
|
#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
|
||||||
|
|
||||||
|
echo "backup finished :)"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$1" = 'zammad-backup' ]; then
|
if [ "$1" = 'zammad-backup' ]; then
|
||||||
@ -40,10 +43,15 @@ if [ "$1" = 'zammad-backup' ]; then
|
|||||||
check_railsserver_available
|
check_railsserver_available
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
NOW_TIMESTAMP=$(date +%s)
|
||||||
|
TOMORROW_DATE=$(date -d@"$((NOW_TIMESTAMP + 24*60*60))" +%Y-%m-%d)
|
||||||
|
|
||||||
zammad_backup
|
zammad_backup
|
||||||
|
|
||||||
# wait until next backup
|
NEXT_TIMESTAMP=$(date -d "$TOMORROW_DATE $BACKUP_TIME" +%s)
|
||||||
sleep "${BACKUP_SLEEP}"
|
NOW_TIMESTAMP=$(date +%s)
|
||||||
|
|
||||||
|
sleep $((NEXT_TIMESTAMP - NOW_TIMESTAMP))
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user