Dockerfile 859 B

1234567891011121314151617181920212223242526272829
  1. FROM nginx:alpine
  2. LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
  3. ADD nginx.conf /etc/nginx/
  4. # If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
  5. ARG CHANGE_SOURCE=false
  6. RUN if [ ${CHANGE_SOURCE} = true ]; then \
  7. # Change application source from dl-cdn.alpinelinux.org to aliyun source
  8. sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \
  9. ;fi
  10. RUN apk update \
  11. && apk upgrade \
  12. && apk add --no-cache bash \
  13. && adduser -D -H -u 1000 -s /bin/bash www-data
  14. ARG PHP_UPSTREAM_CONTAINER=php-fpm
  15. ARG PHP_UPSTREAM_PORT=9000
  16. # Set upstream conf and remove the default conf
  17. RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
  18. && rm /etc/nginx/conf.d/default.conf
  19. CMD ["nginx"]
  20. EXPOSE 80 443