All Downloads are FREE. Search and download functionalities are using the official Maven repository.

python-fastapi.Dockerfile.mustache Maven / Gradle / Ivy

There is a newer version: 7.7.0
Show newest version
FROM python:{{{generatorLanguageVersion}}} AS builder

WORKDIR /usr/src/app

RUN python3 -m venv /venv
ENV PATH="/venv/bin:$PATH"

RUN pip install --upgrade pip

COPY . .
RUN pip install --no-cache-dir .


FROM python:{{{generatorLanguageVersion}}} AS test_runner
WORKDIR /tmp
COPY --from=builder /venv /venv
COPY --from=builder /usr/src/app/tests tests
ENV PATH=/venv/bin:$PATH

# install test dependencies
RUN pip install pytest

# run tests
RUN pytest tests


FROM python:{{{generatorLanguageVersion}}} AS service
WORKDIR /root/app/site-packages
COPY --from=test_runner /venv /venv
ENV PATH=/venv/bin:$PATH




© 2015 - 2024 Weber Informatics LLC | Privacy Policy