Skip to content

Instantly share code, notes, and snippets.

@devries
Created August 14, 2019 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devries/01e7bea18e6b481c1a8f95793ac6b691 to your computer and use it in GitHub Desktop.
Save devries/01e7bea18e6b481c1a8f95793ac6b691 to your computer and use it in GitHub Desktop.
Alpine Nginx image
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