34 lines
892 B
Docker
34 lines
892 B
Docker
FROM nginx:alpine
|
|
|
|
# Standard-Konfiguration entfernen
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
|
|
# Verzeichnisse erstellen mit korrekten Berechtigungen
|
|
RUN mkdir -p /var/cache/nginx /var/log/nginx /etc/nginx/template && \
|
|
chmod -R 777 /var/cache/nginx /var/log/nginx
|
|
|
|
# Kopiere die Template-Konfiguration
|
|
COPY ./nginx.conf /etc/nginx/nginx.conf
|
|
COPY ./default.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Kopiere die SSL-Zertifikate
|
|
COPY ./ssl/ /etc/nginx/ssl/
|
|
|
|
# Startup-Skript zum Ersetzen der Variablen
|
|
COPY ./docker-entrypoint.sh /
|
|
RUN chmod +x /docker-entrypoint.sh
|
|
|
|
#Install Netcat
|
|
RUN apk add --no-cache netcat-openbsd
|
|
|
|
|
|
# Als user www-data laufen lassen
|
|
RUN addgroup -g 1000 www && adduser -D -G www -u 1000 www-data \
|
|
&& chown -R www-data:www /var/cache/nginx /var/log/nginx /etc/nginx
|
|
USER www-data
|
|
|
|
EXPOSE 80 443
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
CMD ["nginx", "-g", "daemon off;"]
|