Guest User

Untitled

a guest
Mar 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. FROM tiangolo/uwsgi-nginx:python2.7
  2.  
  3. RUN pip install flask
  4.  
  5. # By default, allow unlimited file sizes, modify it to limit the file sizes
  6. # To have a maximum of 1 MB (Nginx's default) change the line to:
  7. # ENV NGINX_MAX_UPLOAD 1m
  8. ENV NGINX_MAX_UPLOAD 0
  9.  
  10. # By default, Nginx listens on port 80.
  11. # To modify this, change LISTEN_PORT environment variable.
  12. # (in a Dockerfile or with an option for `docker run`)
  13. ENV LISTEN_PORT 80
  14.  
  15. # Which uWSGI .ini file should be used, to make it customizable
  16. ENV UWSGI_INI /app/uwsgi.ini
  17.  
  18. # URL under which static (not modified by Python) files will be requested
  19. # They will be served by Nginx directly, without being handled by uWSGI
  20. ENV STATIC_URL /static
  21. # Absolute path in where the static files wil be
  22. ENV STATIC_PATH /app/static
  23.  
  24. # If STATIC_INDEX is 1, serve / with /static/index.html directly (or the static URL configured)
  25. # ENV STATIC_INDEX 1
  26. ENV STATIC_INDEX 0
  27.  
  28. # Add demo app
  29. COPY ./app /app
  30. WORKDIR /app
  31.  
  32. RUN pip install --no-cache-dir -r requirements.txt
  33.  
  34. # Make /app/* available to be imported by Python globally to better support several use cases like Alembic migrations.
  35. ENV PYTHONPATH=/app
  36.  
  37. # Copy start.sh script that will check for a /app/prestart.sh script and run it before starting the app
  38. COPY start.sh /start.sh
  39. RUN chmod +x /start.sh
  40.  
  41. # Copy the entrypoint that will generate Nginx additional configs
  42. COPY entrypoint.sh /entrypoint.sh
  43. RUN chmod +x /entrypoint.sh
  44.  
  45. ENTRYPOINT ["/entrypoint.sh"]
  46.  
  47. # Run the start script, it will check for an /app/prestart.sh script (e.g. for migrations)
  48. # And then will start Supervisor, which in turn will start Nginx and uWSGI
  49. CMD ["/start.sh"]
  50.  
  51. EXPOSE 80 443
Add Comment
Please, Sign In to add comment