Squash certbot into proxy

This commit is contained in:
Wojciech Kozlowski 2018-12-11 21:39:22 +00:00
parent 664d3e3431
commit de24631646
8 changed files with 24 additions and 57 deletions

View File

@ -78,24 +78,6 @@ proxy-pull:
proxy: proxy-clean proxy-build proxy-push proxy: proxy-clean proxy-build proxy-push
# -----------------------------------------------------------------------------
# certbot
# -----------------------------------------------------------------------------
certbot-clean:
docker rmi $(DOCKER_REGISTRY)/certbot || /bin/true
certbot-build:
docker-compose build certbot
certbot-push:
docker-compose push certbot
certbot-pull:
docker-compose pull certbot
certbot: certbot-clean certbot-build certbot-push
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# runners # runners
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
@ -184,7 +166,6 @@ clean-builds: \
wiki-clean \ wiki-clean \
nextcloud-clean \ nextcloud-clean \
proxy-clean \ proxy-clean \
certbot-clean \
runner-base-clean \ runner-base-clean \
runner-main-clean \ runner-main-clean \
runner-docker-clean runner-docker-clean

View File

@ -1,17 +0,0 @@
FROM debian:stable-slim
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y upgrade
RUN apt-get -y install \
certbot \
cron \
supervisor
ADD certbot.cron /etc/cron.d/certbot
VOLUME ["/etc/letsencrypt"]
COPY supervisord.conf /etc/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

View File

@ -8,7 +8,6 @@ volumes:
gitlab_logs: gitlab_logs:
gitlab_data: gitlab_data:
letsencrypt: letsencrypt:
letsencrypt_html:
runner_main_etc: runner_main_etc:
runner_main_home: runner_main_home:
runner_docker_etc: runner_docker_etc:
@ -102,7 +101,7 @@ services:
restart: always restart: always
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Reverse proxy served by Nginx # Reverse proxy served by Nginx.
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
proxy: proxy:
@ -121,20 +120,6 @@ services:
- ./proxy/nginx.conf:/etc/nginx/nginx.conf:ro - ./proxy/nginx.conf:/etc/nginx/nginx.conf:ro
- ./proxy/nginx-conf.d:/etc/nginx/conf.d:ro - ./proxy/nginx-conf.d:/etc/nginx/conf.d:ro
- letsencrypt:/etc/letsencrypt - letsencrypt:/etc/letsencrypt
- letsencrypt_html:/var/www/html
restart: always
# ---------------------------------------------------------------------------
# Certbot container running a cron job to renew certificates.
# ---------------------------------------------------------------------------
certbot:
container_name: certbot
build: certbot
image: registry.wojciechkozlowski.eu/wojtek/loki/certbot
volumes:
- letsencrypt:/etc/letsencrypt
- letsencrypt_html:/var/www/html
restart: always restart: always
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------

View File

@ -43,8 +43,8 @@ RUN rm -rf $HTML_PATH && \
mv $HTML_PATH/conf $DOKU_VOL/conf && \ mv $HTML_PATH/conf $DOKU_VOL/conf && \
ln -s $DOKU_VOL/conf $HTML_PATH/conf ln -s $DOKU_VOL/conf $HTML_PATH/conf
ADD nginx-conf.d /etc/nginx/conf.d COPY nginx-conf.d /etc/nginx/conf.d
ADD supervisord.conf /etc/supervisord.conf COPY supervisord.conf /etc/supervisord.conf
EXPOSE 80 EXPOSE 80
VOLUME ["$DOKU_VOL"] VOLUME ["$DOKU_VOL"]

View File

@ -3,6 +3,17 @@ FROM nginx
ENV DEBIAN_FRONTEND noninteractive ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y upgrade RUN apt-get update && apt-get -y upgrade
RUN apt -y install openssl RUN apt -y install \
openssl \
certbot \
cron \
supervisor
RUN mkdir /etc/nginx/cert && openssl dhparam -out /etc/nginx/cert/dhparam.pem 2048 RUN mkdir /etc/nginx/cert && openssl dhparam -out /etc/nginx/cert/dhparam.pem 2048
COPY certbot.cron /etc/cron.d/certbot
COPY supervisord.conf /etc/supervisord.conf
VOLUME ["/etc/letsencrypt"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

View File

@ -7,3 +7,10 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0 stderr_logfile_maxbytes=0
command=cron -f command=cron -f
[program:nginx]
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
command=nginx -g "daemon off;"

View File

@ -4,8 +4,8 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get -y upgrade RUN apt-get update && apt-get -y upgrade
# Add files to setup GitLab repo # Add files to setup GitLab repo
ADD script.deb.sh /tmp/script.deb.sh COPY script.deb.sh /tmp/script.deb.sh
ADD pin-gitlab-runner.pref /etc/apt/preferences.d/pin-gitlab-runner.pref COPY pin-gitlab-runner.pref /etc/apt/preferences.d/pin-gitlab-runner.pref
# Install gitlab-runner # Install gitlab-runner
RUN apt-get -y install gnupg2 && bash /tmp/script.deb.sh && apt-get -y install gitlab-runner RUN apt-get -y install gnupg2 && bash /tmp/script.deb.sh && apt-get -y install gitlab-runner