123456789101112131415161718192021222324252627282930 |
- # pull official base image
- FROM python:3.9.10-slim-buster
- # set work directory
- WORKDIR /usr/src/app
- # set environment variables
- ENV PYTHONDONTWRITEBYTECODE 1
- ENV PYTHONUNBUFFERED 1
- # install psycopg2 dependencies
- RUN apt-get update \
- && apt-get install -y postgresql gcc python3-dev musl-dev
- # install dependencies
- RUN pip install --upgrade pip
- COPY ./requirements.txt .
- RUN pip install -r requirements.txt
- # copy entrypoint.sh
- COPY ./entrypoint.sh .
- RUN sed -i 's/\r$//g' /usr/src/app/entrypoint.sh
- RUN chmod +x /usr/src/app/entrypoint.sh
- # copy project
- COPY . .
- # run entrypoint.sh
- CMD ["bash", "/usr/src/app/entrypoint.sh"]
- # ENTRYPOINT [ "bash", "/usr/src/app/entrypoint.sh" ]
|