Dockerfile 692 B

123456789101112131415161718192021222324252627282930
  1. # pull official base image
  2. FROM python:3.9.10-slim-buster
  3. # set work directory
  4. WORKDIR /usr/src/app
  5. # set environment variables
  6. ENV PYTHONDONTWRITEBYTECODE 1
  7. ENV PYTHONUNBUFFERED 1
  8. # install psycopg2 dependencies
  9. RUN apt-get update \
  10. && apt-get install -y postgresql gcc python3-dev musl-dev
  11. # install dependencies
  12. RUN pip install --upgrade pip
  13. COPY ./requirements.txt .
  14. RUN pip install -r requirements.txt
  15. # copy entrypoint.sh
  16. COPY ./entrypoint.sh .
  17. RUN sed -i 's/\r$//g' /usr/src/app/entrypoint.sh
  18. RUN chmod +x /usr/src/app/entrypoint.sh
  19. # copy project
  20. COPY . .
  21. # run entrypoint.sh
  22. CMD ["bash", "/usr/src/app/entrypoint.sh"]
  23. # ENTRYPOINT [ "bash", "/usr/src/app/entrypoint.sh" ]