diff --git a/Dockerfile b/Dockerfile index 4f67645..8ec747c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ COPY ./www/* /www/ RUN chown -R www:www /var/lib/nginx RUN chown -R www:www /www COPY configs/nginx.conf /etc/nginx/nginx.conf +RUN rm -f /etc/nginx/conf.d/* COPY configs/envs/php7.sh /etc/profile.d/php7.sh RUN chown www:www /var/log/php7 diff --git a/configs/nginx.conf b/configs/nginx.conf index 30eff14..abd18ea 100644 --- a/configs/nginx.conf +++ b/configs/nginx.conf @@ -16,10 +16,10 @@ http { access_log /var/log/nginx/access.log; keepalive_timeout 3000; server { - listen 80; + listen 80 default_server; root /www; index index.html index.htm index.php; - server_name localhost; + server_name %%DOMAIN_NAME%%; client_max_body_size 32m; error_page 500 502 503 504 /50x.html; location = /50x.html { diff --git a/docker-compose.yml b/docker-compose.yml index 56c624a..d8fe4d2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,8 +4,6 @@ services: container_name: gitea-webhooks build: . restart: always - ports: - - '127.0.0.1:3002:80' environment: - SMTP_HOST= - SMTP_PORT= @@ -15,13 +13,14 @@ services: - SMTP_ENCRYPTION= - SECRET_KEY= - RECIPIENTS_PR= + - DOMAIN_NAME=webhooks.chaospott.de labels: - - "traefik.frontend.rule=Host:webhooks.chaospott.de" - - "traefik.port=3002" - - "traefik.docker.network=web" + - traefik.enable=true + - traefik.frontend.rule=Host:webhooks.chaospott.de + - traefik.port=80 + - traefik.docker.network=web networks: - extern: + - web networks: - extern: - external: - name: web + web: + external: true diff --git a/start.sh b/start.sh index a3596f0..72263ab 100644 --- a/start.sh +++ b/start.sh @@ -22,6 +22,9 @@ sed -i "s/\$SMTP_HOST/$SMTP_HOST/g;s/\$SMTP_PORT/$SMTP_PORT/g;s/\$SMTP_FROM/$SMT sed -i "s/%%SECRETKEY%%/$SECRET_KEY/g;s/%%RECIPIENTS_PR%%/$RECIPIENTS_PR/g" /www/config.php +sed -i "s/%%DOMAIN_NAME%%/$DOMAIN_NAME/g" /etc/nginx/nginx.conf + + chown www:www /var/log/nginx/* ln -sf /usr/bin/msmtp /usr/sbin/sendmail nginx