bottle-nginx-uwsgi.dockerfile 734 B

12345678910111213141516171819202122
  1. FROM python:3.6.6-stretch
  2. WORKDIR /bottle
  3. COPY views views
  4. COPY app.py app.py
  5. COPY nginx.conf nginx.conf
  6. COPY requirements.txt requirements.txt
  7. COPY uwsgi.ini uwsgi.ini
  8. RUN curl -s http://nginx.org/keys/nginx_signing.key | apt-key add -
  9. RUN echo "deb http://nginx.org/packages/debian/ stretch nginx" >> /etc/apt/sources.list
  10. RUN echo "deb-src http://nginx.org/packages/debian/ stretch nginx" >> /etc/apt/sources.list
  11. RUN apt-get update -yqq && apt-get install -yqq nginx
  12. RUN pip3 install -r requirements.txt
  13. RUN sed -i 's|include .*/conf/uwsgi_params;|include /etc/nginx/uwsgi_params;|g' /bottle/nginx.conf
  14. EXPOSE 8080
  15. CMD nginx -c /bottle/nginx.conf && uwsgi --ini /bottle/uwsgi.ini --processes $(($(nproc)*3)) --wsgi app:app