From 03f7bc78d05fec00016114a5547308f6b50e9963 Mon Sep 17 00:00:00 2001 From: "Pavel@Vostro5468" Date: Sun, 27 Mar 2022 12:28:38 +0300 Subject: [PATCH] added agola ci, cron env and apache error to stdout https://git.mxfox.ru/Infrastructure/fox-web-basic/issues/2#issue-28 https://git.mxfox.ru/Infrastructure/fox-web-basic/issues/1#issue-27 --- .agola/config.yml | 47 +++++++++++++++++++++++++++++++++++++ Dockerfile | 5 ++-- rootfs/docker-entrypoint.sh | 3 +++ 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .agola/config.yml diff --git a/.agola/config.yml b/.agola/config.yml new file mode 100644 index 0000000..a56cbae --- /dev/null +++ b/.agola/config.yml @@ -0,0 +1,47 @@ +version: v0 +runs: + - name: Build image + docker_registries_auth: + 'mxfox.ru': + username: + from_variable: mxfoxdockerlogin + password: + from_variable: mxfoxdockersecret + tasks: + - name: build docker image + runtime: + containers: + - image: mxfox.ru/test/docker-buildx:dind-git + privileged: true + #shell: /busybox/sh + working_dir: /workspace + environment: + DOCKERLOGIN: + from_variable: mxfoxdockerlogin + DOCKERPASS: + from_variable: mxfoxdockersecret + steps: + - clone: + - run: + name: buildX prepare + command: buildx-bgstart.sh + + - run: + name: buildX build + command: | + case ${AGOLA_GIT_BRANCH} in + master) + export xBuildSuffix=" -t mxfox.ru/chimera/fox-web-basic:master-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/chimera/fox-web-basic:latest --push" + ;; + test) + export xBuildSuffix=" -t mxfox.ru/chimera/fox-web-basic:test-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/chimera/fox-web-basic:test --push" + ;; + php7.4) + export xBuildSuffix=" -t mxfox.ru/chimera/fox-web-basic:php-7.4-${AGOLA_GIT_COMMITSHA:0:10} -t mxfox.ru/chimera/fox-web-basic:php-7.4 --push" + ;; + *) + export xBuildSuffix="" + ;; + esac + docker login mxfox.ru -u ${DOCKERLOGIN} -p ${DOCKERPASS} + docker buildx build --platform linux/amd64,linux/arm64 . ${xBuildSuffix} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f037866..9fb4475 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.04 -ENV php_version=7.4 +ENV php_version=8.1 COPY ["/rootfs/etc/timezone", "/rootfs/etc/localtime", "/etc/"] @@ -29,7 +29,8 @@ RUN apt-get update -y \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /var/www/html/* \ - && a2enmod rewrite + && a2enmod rewrite \ + && sed -i -e 's/^ErrorLog.*$/ErrorLog \/dev\/stdout/g' /etc/apache2/apache2.conf COPY rootfs / WORKDIR /var/www/html diff --git a/rootfs/docker-entrypoint.sh b/rootfs/docker-entrypoint.sh index e34edd8..75d0130 100755 --- a/rootfs/docker-entrypoint.sh +++ b/rootfs/docker-entrypoint.sh @@ -1,4 +1,7 @@ #!/bin/sh +echo -n "Copying FOX ENV..."; +env | grep -E "^FOX_" > /etc/security/pam_env.conf +echo "OK" find /etc/fox-start.d -maxdepth 1 -type f -exec {} \; echo "Starting cron:"