Skip to content

Commit

Permalink
Merge pull request #75 from 1thorsten/1.2.0
Browse files Browse the repository at this point in the history
RELEASE 1.2.0
  • Loading branch information
1thorsten authored Jul 20, 2023
2 parents ea4f843 + d2f538c commit c850ce2
Show file tree
Hide file tree
Showing 24 changed files with 3,042 additions and 105 deletions.
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ RUN set +x && \
time upx --brute doclig && \
set x

FROM debian:bullseye-slim
ENV PHP_VERSION=7.4
FROM debian:bookworm-slim
ENV PHP_VERSION=8.2

ARG USER=hoax

LABEL maintainer="Thorsten Winkler"
Expand All @@ -22,7 +23,7 @@ ENV TZ=Europe/Berlin

RUN set -x && \
apt-get update -y && \
apt-get upgrade -y && \
apt-get dist-upgrade -y && \
APT_SYSTEM="sudo tzdata ca-certificates" && \
APT_HTTP="nginx nginx-extras" && \
APT_PHP="php-curl php-fpm php-mbstring" && \
Expand All @@ -42,13 +43,13 @@ COPY --from=doclig-build /doclig/doclig /usr/local/bin
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

ENV PHP7_ETC=/etc/php/$PHP_VERSION
ENV PHP7_SERVICE=php${PHP_VERSION}-fpm
ENV PHP7_SOCK=/var/run/php/php${PHP_VERSION}-fpm.sock
ENV PHP_ETC=/etc/php/$PHP_VERSION
ENV PHP_SERVICE=php${PHP_VERSION}-fpm
ENV PHP_SOCK=/var/run/php/php${PHP_VERSION}-fpm.sock
ENV PHP_LOG_SYSOUT=true

# http-over-all part
ARG RELEASE="1.1.18-05"
ARG RELEASE="1.2.0"

ARG SSL_COUNTRY=DE
ARG SSL_STATE=Berlin
Expand All @@ -73,6 +74,7 @@ RUN set -x && \
useradd -d /home/$USER -u 1000 -g 1000 -m -s /bin/bash $USER && \
echo "$USER ALL=(ALL) NOPASSWD:SETENV: /scripts/http-over-all.sh" > /etc/sudoers.d/$USER && \
echo "$USER ALL=(ALL) NOPASSWD: /scripts/force-update.sh" >> /etc/sudoers.d/$USER && \
echo "$USER ALL=(ALL) NOPASSWD: /usr/bin/umount" >> /etc/sudoers.d/$USER && \
echo "www-data ALL=(ALL) NOPASSWD: /scripts/force-update.sh" >> /etc/sudoers.d/www-data && \
chmod 0440 /etc/sudoers.d/$USER && \
chmod 0440 /etc/sudoers.d/www-data && \
Expand All @@ -84,4 +86,4 @@ RUN set -x && \

HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "/scripts/healthcheck.sh" ]
USER $USER
ENTRYPOINT sudo -E /scripts/http-over-all.sh
ENTRYPOINT ["/scripts/docker-run-wrapper.sh"]
3 changes: 2 additions & 1 deletion example-doclig.env
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
TINY_INSTANCE=true
CRYPT_KEY=2+oHyXHtwC6uxkliy4/ebM5aITT4eF9L2+Sf4YyIVUU=\n%
CRYPT_KEY=ps7UDnEXq1cmrMzCvNYE5okXK6B4HlckOQWFQCbJ/Nk=
PERIODIC_JOB_INTERVAL=3
FORCE_UPDATE_LOCK=20
PROXY_MAX_SIZE=600m
PROXY_INACTIVE=1h
PHP_LOG_ENABLED=true
CONNECTED_URLS=
#CONNECTED_URLS=http://127.0.0.1/func/show-proxy-headers
#CONNECTED_URLS=http://172.16.3.22:8338/func/show-headers,http://172.16.3.22:8338/force-update,http://172.16.3.22:8338/force-update
Expand Down
4 changes: 2 additions & 2 deletions example.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TINY_INSTANCE=true
TINY_INSTANCE=false
CRYPT_KEY=2+oHyXHtwC6uxkliy4/ebM5aITT4eF9L2+Sf4YyIVUU=\n%
PERIODIC_JOB_INTERVAL=3
PERIODIC_JOB_INTERVAL=1
FORCE_UPDATE_LOCK=20
PROXY_MAX_SIZE=600m
PROXY_INACTIVE=1h
Expand Down
4 changes: 2 additions & 2 deletions incontainer/connect-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,9 @@ function start_http_server() {
sed -i "s|#proxy_cache_path|proxy_cache_path|;" "/etc/nginx/nginx.conf"
fi

echo "service ${PHP7_SERVICE} start"
echo "service ${PHP_SERVICE} start"
rm -rf /run/php
service "${PHP7_SERVICE}" "start"
service "${PHP_SERVICE}" "start"

nginx -v

Expand Down
18 changes: 18 additions & 0 deletions incontainer/docker-run-wrapper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# SIGTERM-handler
# https://blog.codeship.com/trapping-signals-in-docker-containers/
function term_handler() {
echo "$(date +'%T'): stop http server and unmount all filesystems / EXIT signal detected"
for i in $(mount | awk '{print $3}' | grep "^/remote/"); do
echo "sudo /usr/bin/umount --force $i"
sudo /usr/bin/umount --force "$i"
done
service nginx stop
echo "$(date +'%T'): all terminated"
exit 143 # 128 + 15 -- SIGTERM
}
trap "term_handler" EXIT

echo "sudo -E /scripts/http-over-all.sh"
sudo -E /scripts/http-over-all.sh
Loading

0 comments on commit c850ce2

Please sign in to comment.