Dockerfile 761 B

1234567891011121314151617181920212223242526272829303132
  1. FROM nginx:stable-alpine
  2. # Default environment
  3. ENV LANG=en_US.UTF-8
  4. ENV LC_ALL=en_US.UTF-8
  5. # Install necessary third-party software
  6. RUN apk update && apk add \
  7. vim alpine-sdk linux-headers python3 python3-dev pcre pcre-dev
  8. RUN pip3 install --upgrade pip uwsgi pipenv
  9. # Install application dependencies
  10. COPY Pipfile /Pipfile
  11. RUN pipenv lock -r > /requirements.txt
  12. RUN pip3 install -r requirements.txt
  13. # Configure NGINX
  14. RUN echo "daemon off;" >> /etc/nginx/nginx.conf
  15. COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
  16. # Copy application source code
  17. COPY acme /app
  18. COPY docker/uwsgi.ini uwsgi.ini
  19. # Prepare run procedure
  20. COPY docker/run.sh /run.sh
  21. RUN chmod a+x /run.sh
  22. RUN adduser -D -u 1000 uwsgi
  23. # Startup hook
  24. EXPOSE 80
  25. ENTRYPOINT [ "/run.sh" ]