Dockerfile 699 B

123456789101112131415161718192021222324
  1. FROM nginx:alpine
  2. MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
  3. ADD nginx.conf /etc/nginx/
  4. ARG PHP_UPSTREAM_CONTAINER=php-fpm
  5. ARG PHP_UPSTREAM_PORT=9000
  6. # fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source.
  7. RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories
  8. RUN apk update \
  9. && apk upgrade \
  10. && apk add --no-cache bash \
  11. && adduser -D -H -u 1000 -s /bin/bash www-data
  12. # Set upstream conf and remove the default conf
  13. RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
  14. && rm /etc/nginx/conf.d/default.conf
  15. CMD ["nginx"]
  16. EXPOSE 80 443