use port 8080 for nginx (#193)
* use port 8080 for nginx Signed-off-by: André Bauer <monotek23@gmail.com> * fix test Signed-off-by: André Bauer <monotek23@gmail.com> * fix port in override file Signed-off-by: André Bauer <monotek23@gmail.com> * fix logging Signed-off-by: André Bauer <monotek23@gmail.com> * fix compose cmd Signed-off-by: André Bauer <monotek23@gmail.com> * fix ci timeout Signed-off-by: André Bauer <monotek23@gmail.com>
This commit is contained in:
parent
b1ce16963a
commit
9eda319ed3
4
.github/docker-image-build.sh
vendored
4
.github/docker-image-build.sh
vendored
@ -9,6 +9,6 @@ DOCKER_IMAGES="zammad zammad-elasticsearch zammad-postgresql"
|
|||||||
|
|
||||||
# shellcheck disable=SC2153
|
# shellcheck disable=SC2153
|
||||||
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do
|
for DOCKER_IMAGE in ${DOCKER_IMAGES}; do
|
||||||
echo "Build Zammad Docker image ${DOCKER_IMAGE} for local test"
|
echo "Build Zammad Docker image ${DOCKER_IMAGE} for local or ci tests"
|
||||||
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_IMAGE}" -f "containers/${DOCKER_IMAGE}/Dockerfile" .
|
docker build --pull --no-cache --build-arg BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" -t "${DOCKER_IMAGE}-local" -f "containers/${DOCKER_IMAGE}/Dockerfile" .
|
||||||
done
|
done
|
||||||
|
2
.github/tests.sh
vendored
2
.github/tests.sh
vendored
@ -8,7 +8,7 @@ set -o pipefail
|
|||||||
|
|
||||||
docker-compose logs --timestamps --follow &
|
docker-compose logs --timestamps --follow &
|
||||||
|
|
||||||
until (curl -I --silent --fail localhost | grep -iq "HTTP/1.1 200 OK"); do
|
until (curl -I --silent --fail localhost:8080 | grep -iq "HTTP/1.1 200 OK"); do
|
||||||
echo "wait for zammad to be ready..."
|
echo "wait for zammad to be ready..."
|
||||||
sleep 15
|
sleep 15
|
||||||
done
|
done
|
||||||
|
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
@ -48,10 +48,8 @@ jobs:
|
|||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
- name: build docker containers
|
- name: build docker containers
|
||||||
run: .github/docker-image-build.sh
|
run: .github/docker-image-build.sh
|
||||||
- name: use images build by ci
|
|
||||||
run: sed -i -e 's#${IMAGE_REPO}:##g' -e 's#${VERSION}##g' docker-compose.yml
|
|
||||||
- name: run docker-compose up
|
- name: run docker-compose up
|
||||||
run: docker-compose up --detach
|
run: docker-compose -f docker-compose.yml -f docker-compose.override.yml -f docker-compose.override-local.yml up --detach
|
||||||
- name: add autowizard file
|
- name: add autowizard file
|
||||||
run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad
|
run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad
|
||||||
- name: run tests
|
- name: run tests
|
||||||
@ -62,7 +60,7 @@ jobs:
|
|||||||
- codespell
|
- codespell
|
||||||
- lint-docker-compose-file
|
- lint-docker-compose-file
|
||||||
- super-linter
|
- super-linter
|
||||||
timeout-minutes: 10
|
timeout-minutes: 20
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -8,6 +8,7 @@ ARG DEBIAN_FRONTEND=noninteractive
|
|||||||
ENV GIT_BRANCH stable
|
ENV GIT_BRANCH stable
|
||||||
ENV GIT_URL ${PROJECT_URL}.git
|
ENV GIT_URL ${PROJECT_URL}.git
|
||||||
ENV PROJECT_URL https://github.com/zammad/zammad
|
ENV PROJECT_URL https://github.com/zammad/zammad
|
||||||
|
ENV RAILS_LOG_TO_STDOUT true
|
||||||
ENV RAILS_ENV production
|
ENV RAILS_ENV production
|
||||||
ENV TAR_GZ_URL ${PROJECT_URL}/archive/${GIT_BRANCH}.tar.gz
|
ENV TAR_GZ_URL ${PROJECT_URL}/archive/${GIT_BRANCH}.tar.gz
|
||||||
ENV ZAMMAD_DIR /opt/zammad
|
ENV ZAMMAD_DIR /opt/zammad
|
||||||
|
@ -12,6 +12,7 @@ set -e
|
|||||||
: "${ELASTICSEARCH_SSL_VERIFY:=true}"
|
: "${ELASTICSEARCH_SSL_VERIFY:=true}"
|
||||||
: "${MEMCACHED_HOST:=zammad-memcached}"
|
: "${MEMCACHED_HOST:=zammad-memcached}"
|
||||||
: "${MEMCACHED_PORT:=11211}"
|
: "${MEMCACHED_PORT:=11211}"
|
||||||
|
: "${NGINX_PORT:=8080}"
|
||||||
: "${NGINX_SERVER_NAME:=_}"
|
: "${NGINX_SERVER_NAME:=_}"
|
||||||
: "${NGINX_SERVER_SCHEME:=\$scheme}"
|
: "${NGINX_SERVER_SCHEME:=\$scheme}"
|
||||||
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
: "${POSTGRESQL_HOST:=zammad-postgresql}"
|
||||||
@ -120,7 +121,8 @@ if [ "$1" = 'zammad-nginx' ]; then
|
|||||||
check_zammad_ready
|
check_zammad_ready
|
||||||
|
|
||||||
# configure nginx
|
# configure nginx
|
||||||
sed -e "s#proxy_set_header X-Forwarded-Proto .*;#proxy_set_header X-Forwarded-Proto ${NGINX_SERVER_SCHEME};#g" \
|
sed -e "s#listen .*#listen ${NGINX_PORT};#g" \
|
||||||
|
-e "s#proxy_set_header X-Forwarded-Proto .*;#proxy_set_header X-Forwarded-Proto ${NGINX_SERVER_SCHEME};#g" \
|
||||||
-e "s#server .*:3000#server ${ZAMMAD_RAILSSERVER_HOST}:${ZAMMAD_RAILSSERVER_PORT}#g" \
|
-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 .*:6042#server ${ZAMMAD_WEBSOCKET_HOST}:${ZAMMAD_WEBSOCKET_PORT}#g" \
|
||||||
-e "s#server_name .*#server_name ${NGINX_SERVER_NAME};#g" \
|
-e "s#server_name .*#server_name ${NGINX_SERVER_NAME};#g" \
|
||||||
|
@ -28,7 +28,6 @@ if [ "$1" = 'builder' ]; then
|
|||||||
contrib/packager.io/fetch_locales.rb
|
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 -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 "/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
|
sed -i 's/.*scheduler_\(err\|out\).log.*//g' script/scheduler.rb
|
||||||
touch db/schema.rb
|
touch db/schema.rb
|
||||||
bundle exec rake assets:precompile
|
bundle exec rake assets:precompile
|
||||||
|
27
docker-compose.override-local.yml
Normal file
27
docker-compose.override-local.yml
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
zammad-backup:
|
||||||
|
image: zammad-postgresql-local
|
||||||
|
|
||||||
|
zammad-elasticsearch:
|
||||||
|
image: zammad-elasticsearch-local
|
||||||
|
|
||||||
|
zammad-init:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-nginx:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-postgresql:
|
||||||
|
image: zammad-postgresql-local
|
||||||
|
|
||||||
|
zammad-railsserver:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-scheduler:
|
||||||
|
image: zammad-local
|
||||||
|
|
||||||
|
zammad-websocket:
|
||||||
|
image: zammad-local
|
@ -3,4 +3,4 @@ services:
|
|||||||
|
|
||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "8080:8080"
|
||||||
|
@ -51,7 +51,7 @@ services:
|
|||||||
zammad-nginx:
|
zammad-nginx:
|
||||||
command: ["zammad-nginx"]
|
command: ["zammad-nginx"]
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "8080"
|
||||||
depends_on:
|
depends_on:
|
||||||
- zammad-railsserver
|
- zammad-railsserver
|
||||||
image: ${IMAGE_REPO}:zammad${VERSION}
|
image: ${IMAGE_REPO}:zammad${VERSION}
|
||||||
|
Loading…
Reference in New Issue
Block a user