2023-02-23 09:57:43 +00:00
|
|
|
FROM ghcr.io/sartography/python:3.11 AS base
|
|
|
|
|
|
|
|
ARG commit
|
|
|
|
|
|
|
|
# Prepare Python virtual environment
|
|
|
|
ENV VIRTUAL_ENV=/app/venv
|
|
|
|
RUN python3 -m venv $VIRTUAL_ENV
|
|
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
2022-09-14 18:55:46 +00:00
|
|
|
|
|
|
|
RUN useradd _gunicorn --no-create-home --user-group
|
|
|
|
|
2023-02-23 09:57:43 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
FROM base AS setup
|
|
|
|
|
|
|
|
RUN pip install poetry
|
2022-12-23 02:02:06 +00:00
|
|
|
# libpq-dev for pg_config executable, which is needed for psycopg2
|
2023-02-23 09:57:43 +00:00
|
|
|
RUN apt-get update -q \
|
|
|
|
&& apt-get install -y -q \
|
2022-12-23 02:02:06 +00:00
|
|
|
libpq-dev
|
|
|
|
|
2022-12-24 00:07:03 +00:00
|
|
|
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
|
|
|
|
|
2023-02-23 09:57:43 +00:00
|
|
|
FROM base AS final
|
|
|
|
|
|
|
|
LABEL source="https://github.com/sartography/connector-proxy-status-im"
|
|
|
|
LABEL description="Connector gateway for external services."
|
|
|
|
|
|
|
|
COPY --from=setup /app /app
|
2022-09-14 18:55:46 +00:00
|
|
|
|
2023-02-13 16:58:59 +00:00
|
|
|
ENTRYPOINT ["/app/bin/boot_server_in_docker"]
|