forked from loafle/openapi-generator-original
* [python-fastapi] Added new generator See https://fastapi.tiangolo.com/ for more details about FastAPI Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com> * [python-fastapi] Added samples Signed-off-by: Nikita Vakula <programmistov.programmist@gmail.com>
31 lines
529 B
Docker
31 lines
529 B
Docker
FROM python:3.6 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:3.6 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:3.6 AS service
|
|
WORKDIR /root/app/site-packages
|
|
COPY --from=test_runner /venv /venv
|
|
ENV PATH=/venv/bin:$PATH
|