bx-gitea-integration/Dockerfile

29 lines
694 B
Docker

FROM python:3.10
# Configure Poetry
ENV POETRY_VERSION=1.2.0
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# Install poetry separated from system interpreter
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
# Add `poetry` to PATH
ENV PATH="${PATH}:${POETRY_VENV}/bin"
ENV WORKING_DIR=/app
# Set the working directory to /app
WORKDIR ${WORKING_DIR}
# Copy the project to the container
COPY . ${WORKING_DIR}
# COPY .env ${WORKING_DIR}
COPY pyproject.toml .
RUN poetry install
CMD poetry run uvicorn app.main:app --host 0.0.0.0 --port 80