Created
August 14, 2019 18:33
-
-
Save devries/01e7bea18e6b481c1a8f95793ac6b691 to your computer and use it in GitHub Desktop.
Alpine Nginx image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.10 | |
RUN apk update && apk upgrade | |
RUN apk add openssl curl ca-certificates | |
RUN printf "%s%s%s\n" \ | |
"http://nginx.org/packages/mainline/alpine/v" \ | |
`egrep -o '^[0-9]+\.[0-9]+' /etc/alpine-release` \ | |
"/main" \ | |
| tee -a /etc/apk/repositories | |
RUN curl -o /etc/apk/keys/nginx_signing.rsa.pub https://nginx.org/keys/nginx_signing.rsa.pub | |
RUN apk add nginx | |
RUN sed "s/access_log\s*[^;]*/access_log \/dev\/stdout/g" -i /etc/nginx/nginx.conf | |
RUN sed "s/error_log\s*[^;]*/error_log \/dev\/stdout/g" -i /etc/nginx/nginx.conf | |
RUN echo "daemon off;" >> /etc/nginx/nginx.conf | |
EXPOSE 80 | |
EXPOSE 443 | |
CMD ["/usr/sbin/nginx"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment