Guest User

dockerfile-github02

a guest
Jun 12th, 2020
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1.  
  2. FROM python:3.8-slim
  3.  
  4. #### For development within the container in VS Code ##
  5. # https://code.visualstudio.com/docs/remote/containers
  6. # https://github.com/Microsoft/vscode-remote-try-python
  7.  
  8. # Allow for an orderly, graceful shutdown of services
  9. # Specifically in our case:
  10. # 1. give coverage a chance to send its report to coveralls.io
  11. # 2. allow celerybeat to delete its pid file (does this actually happen?)
  12. STOPSIGNAL SIGINT
  13.  
  14. # Configure apt
  15. ENV DEBIAN_FRONTEND=noninteractive
  16. RUN apt-get update \
  17. && apt-get -y install --no-install-recommends apt-utils 2>&1
  18.  
  19. RUN pip install pylint
  20.  
  21. # Install git, process tools, lsb-release (common in install instructions for CLIs)
  22. RUN apt-get install -y git procps lsb-release
  23.  
  24. # Required for psycopg2: https://github.com/psycopg/psycopg2/issues/699
  25. RUN apt-get install -y --no-install-recommends libpq-dev
  26.  
  27. # Install any missing dependencies for enhanced language service
  28. RUN apt-get install -y libicu[0-9][0-9]
  29.  
  30. # Install uwsgi
  31. RUN apt-get install -y build-essential
  32.  
  33. RUN apt-get install -y libpcre3 libpcre3-dev
  34.  
  35. RUN pip install uwsgi
  36. # Install python requirements
  37. # Docker only rebuilds when there are changes to these files
  38. # https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
  39. #COPY ./requirements-production.txt requirements-production.txt
  40. #COPY ./requirements.txt requirements.txt
  41. #RUN pip install -r requirements.txt
  42.  
  43. ######################################################
  44.  
  45. # Set environment variables
  46.  
  47. # Don't create .pyc files (why don't we want these?)
  48. ENV PYTHONDONTWRITEBYTECODE 1
  49. # Prevent docker from buffering console output
  50. ENV PYTHONUNBUFFERED 1
  51.  
  52. ENV POSTGRES_HOST "db"
  53.  
  54. ENV REDIS_HOST "redis"
  55.  
  56. # Set working directory for subsequent RUN ADD COPY CMD instructions
  57. #COPY . /app/
  58. WORKDIR /app/
  59.  
  60. # The port
  61. EXPOSE 8000
  62.  
  63. #### More from https://github.com/Microsoft/vscode-remote-try-python ##
  64.  
  65. # Clean up
  66. RUN apt-get autoremove -y \
  67. && apt-get clean -y \
  68. && rm -rf /var/lib/apt/lists/*
  69. ENV DEBIAN_FRONTEND=dialog
  70.  
  71. # Set the default shell to bash rather than sh
  72. ENV SHELL /bin/bash
  73.  
  74. #######################################################################
  75.  
  76. # RUN adduser --disabled-password appuser
  77. # USER appuser
Add Comment
Please, Sign In to add comment