Commit 0f750579 authored by Ulf Seltmann's avatar Ulf Seltmann
Browse files

added configurable fcgi-target

* also extended gitlab-ci process
* renamed environment variable
* updated documentation
parent a161193a
Pipeline #545 passed with stages
in 1 minute and 11 seconds
stages:
- image
- build
- publish
'2.4':
stage: image
docker_build_image_2.4:
stage: build
image: docker:latest
services:
- docker:dind
script: |
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
export suffix=`expr $CI_COMMIT_TAG ':' '2.4-\(.*\)'`
docker build --pull \
-t ubleipzig/symfony-httpd:2.4 \
--build-arg HTTP_PROXY=${HTTP_PROXY} \
--build-arg HTTPS_PROXY=${HTTPS_PROXY} \
--build-arg NO_PROXY=${NO_PROXY} \
--build-arg http_proxy=${HTTP_PROXY} \
--build-arg https_proxy=${HTTPS_PROXY} \
--build-arg no_proxy=${NO_PROXY} \
-t image \
-f 2.4/Dockerfile \
2.4
docker save --output=image.tar.gz image
artifacts:
name: docker-image
paths:
- image.tar.gz
tags:
- docker
docker_publish_alpha_2.4:
stage: publish
image: docker:latest
services:
- docker:dind
script: |
test "${DOCKER_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
docker tag image ubleipzig/symfony-httpd:alpha-2.4-${CI_COMMIT_REF_NAME}
docker push ubleipzig/symfony-httpd:alpha-2.4-${CI_COMMIT_REF_NAME}
tags:
- docker
dependencies:
- docker_build_image_2.4
only:
- /^[0-9]+-/
docker_publish_staging_2.4:
stage: publish
image: docker:latest
services:
- docker:dind
script: |
test "${DOCKER_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
docker load --input=image.tar.gz
docker tag image ubleipzig/symfony-httpd:staging
docker push ubleipzig/symfony-httpd:staging
tags:
- docker
dependencies:
- docker_build_image_2.4
only:
- master
docker_publish_production_2.4:
stage: publish
image: docker:latest
services:
- docker:dind
script: |
test "${DOCKER_AUTH_CONFIG}" == "" && echo "docker-config does not exists, aborting!" && false
mkdir -p ~/.docker && echo "$DOCKER_AUTH_CONFIG" >~/.docker/config.json
suffix=`expr $CI_COMMIT_TAG ':' '2.4-\(.*\)'`
docker load --input=image.tar.gz
docker tag image ubleipzig/symfony-httpd:2.4
docker push ubleipzig/symfony-httpd:2.4
for tag in "latest" "2" "2.4-${suffix}"; do
docker tag ubleipzig/symfony-httpd:2.4 ubleipzig/symfony-httpd:${tag}
......@@ -20,7 +81,9 @@ stages:
done
tags:
- docker
dependencies:
- docker_build_image_2.4
only:
- /^2.4/
- /^2.4-/
except:
- branches
\ No newline at end of file
FROM ubleipzig/httpd:2.4-1
ENV APACHE_ALIAS_PATH="/"
ENV BASE_PATH="/" \
FCGI_TARGET="php:9000"
COPY assets/symfony.conf /etc/apache2/conf-available/symfony.conf
RUN a2enconf symfony
\ No newline at end of file
<FilesMatch \.php$>
SetHandler "proxy:fcgi://php:9000"
SetHandler "proxy:fcgi://${FCGI_TARGET}"
</FilesMatch>
Alias ${APACHE_ALIAS_PATH} ${APACHE_DOC_ROOT}
......
# Changelog
## 2.4-2 - 2018-07-31
### Added
* support for configurable FCGI target as environment variable `FCGI_TARGET`
### Changed
* renamed `APACHE_ALIAS_PATH` to more generic `BASE_PATH`
## 2.4-1 - 2018-07-10
* Initial release
\ No newline at end of file
* Initial release
[2.4-2]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/docker/symfony-httpd/compare/2.4-1...2.4-2
\ No newline at end of file
......@@ -10,6 +10,10 @@
See [ubleipzig:httpd].
## advanced configuration
* `BASE_PATH="/"`: sets the path-prefix where the api shall be accessible
* `FCGI_TARGET="php:9000"`: sets the host and port where the application server is accessible by apache2
[ubleipzig:httpd]: https://hub.docker.com/r/ubleipzig/httpd
[symfony/apache-pack]: https://github.com/symfony/recipes-contrib/blob/master/symfony/apache-pack/1.0/public/.htaccess
[2.4/Dockerfile]: https://git.sc.uni-leipzig.de/ubl/bdd_dev/docker/symfony-httpd/blob/master/.gitlab-ci.yml
......@@ -10,6 +10,10 @@
Siehe [ubleipzig:httpd].
## erweiterte Konfiguration
* `BASE_PATH="/"`: setzt den Pfad-Prefix, unter welchem die API zu erreichen ist
* `FCGI_TARGET="php:9000"`: setzt den Host und Port, an welchem Apache2 den Applikationsserver erreicht
[ubleipzig:httpd]: https://hub.docker.com/r/ubleipzig/httpd
[symfony/apache-pack]: https://github.com/symfony/recipes-contrib/blob/master/symfony/apache-pack/1.0/public/.htaccess
[2.4/Dockerfile]: https://github.com/ubleipzig/symfony-httpd/blob/master/2.4/Dockerfile
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment