2022-11-28 19:24:51 +00:00
|
|
|
FROM ghcr.io/sartography/python:3.11
|
2022-09-14 18:55:46 +00:00
|
|
|
|
|
|
|
RUN pip install poetry
|
|
|
|
RUN useradd _gunicorn --no-create-home --user-group
|
|
|
|
|
2022-12-23 02:02:06 +00:00
|
|
|
# libpq-dev for pg_config executable, which is needed for psycopg2
|
|
|
|
RUN set -xe \
|
|
|
|
&& apt-get update -q \
|
|
|
|
&& apt-get install -y -q \
|
|
|
|
libpq-dev
|
|
|
|
|
2022-12-24 00:07:03 +00:00
|
|
|
WORKDIR /app
|
|
|
|
ADD pyproject.toml poetry.lock /app/
|
|
|
|
ADD connectors /app/connectors
|
|
|
|
RUN poetry install
|
|
|
|
|
|
|
|
COPY . /app/
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2022-12-23 02:02:06 +00:00
|
|
|
# remove packages that are not needed in production.
|
|
|
|
# just for security. won't help image size.
|
2022-09-14 18:55:46 +00:00
|
|
|
RUN set -xe \
|
2022-12-23 01:42:49 +00:00
|
|
|
&& apt-get remove -y \
|
|
|
|
gcc \
|
|
|
|
libssl-dev \
|
|
|
|
postgresql-client \
|
|
|
|
python3-dev \
|
2022-09-14 18:55:46 +00:00
|
|
|
&& apt-get autoremove -y \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2023-02-13 16:50:42 +00:00
|
|
|
ENTRYPOINT ./bin/boot_server_in_docker
|