2022-06-20 15:12:30 -04:00
|
|
|
FROM ghcr.io/sartography/python:3.9
|
2021-02-11 16:07:28 -05:00
|
|
|
|
2022-06-20 15:12:30 -04:00
|
|
|
RUN pip install poetry
|
2021-02-11 16:07:28 -05:00
|
|
|
RUN useradd _gunicorn --no-create-home --user-group
|
|
|
|
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y -q \
|
|
|
|
gcc libssl-dev \
|
|
|
|
curl postgresql-client git-core \
|
|
|
|
gunicorn3 postgresql-client
|
2020-05-24 18:30:57 -04:00
|
|
|
|
|
|
|
WORKDIR /app
|
2022-06-20 15:12:30 -04:00
|
|
|
COPY pyproject.toml poetry.lock /app/
|
|
|
|
RUN poetry install
|
2020-05-24 18:30:57 -04:00
|
|
|
|
|
|
|
RUN set -xe \
|
2020-05-24 20:52:51 -04:00
|
|
|
&& apt-get remove -y gcc python3-dev libssl-dev \
|
|
|
|
&& apt-get autoremove -y \
|
|
|
|
&& apt-get clean -y \
|
2021-02-11 16:07:28 -05:00
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
2020-05-24 20:52:51 -04:00
|
|
|
|
|
|
|
COPY . /app/
|
2022-06-20 15:12:30 -04:00
|
|
|
|
|
|
|
# run poetry install again AFTER copying the app into the image
|
|
|
|
# otherwise it does not know what the main app module is
|
|
|
|
RUN poetry install
|
|
|
|
|
|
|
|
CMD ./bin/boot_server_in_docker
|