FROM alpine:latest # install packages RUN apk add --no-cache nginx shadow curl tini RUN rm -fr /var/cache/apk/* # update nginx user RUN groupmod --gid 1000 nginx RUN usermod --uid 1000 nginx # remove build packages RUN apk del shadow # make log syms RUN ln -sf /dev/stdout /var/log/nginx/access.log && \ ln -sf /dev/stderr /var/log/nginx/error.log # copy configs RUN mkdir -p /etc/nginx COPY ./*.conf /etc/nginx/ RUN chown -R nginx:nginx /etc/nginx # copy entrypoint COPY ./entrypoint.sh /usr/local/bin/entrypoint RUN chmod +x /usr/local/bin/entrypoint # do the USER nginx ENTRYPOINT ["/sbin/tini", "--"] CMD ["/usr/local/bin/entrypoint"]