FROM python:3.11-slim-buster AS Build ENV PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ POETRY_NO_INTERACTION=1 \ POETRY_VIRTUALENVS_CREATE=false \ POETRY_VERSION=1.7.1 WORKDIR /app COPY ./pyproject.toml /app/ RUN apt-get update && \ apt-get install -y gcc g++ unixodbc-dev && \ pip install "poetry==$POETRY_VERSION" && \ poetry export --without-hashes --format requirements.txt --output requirements.txt && \ python3 -m pip wheel --no-cache-dir --no-deps -w /app/wheels -r requirements.txt FROM python:3.11-slim-buster AS Run ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH RUN useradd -m -u 1000 user USER user COPY --from=build /app/wheels $HOME/app/wheels WORKDIR $HOME/app/wheels RUN pip3 --no-cache-dir install *.whl COPY --chown=user ./palmyra-fin-chat $HOME/app WORKDIR $HOME/app ENTRYPOINT [ "writer", "run" ] EXPOSE 8080 CMD [ ".", "--port", "8080", "--host", "0.0.0.0" ]