Files
book_library_server/docker/build.dockerfile
2023-05-17 17:06:38 +02:00

30 lines
686 B
Docker

FROM ghcr.io/flibusta-apps/base_docker_images:3.11-postgres-asyncpg-poetry-buildtime AS build-image
WORKDIR /root/poetry
COPY pyproject.toml poetry.lock /root/poetry/
ENV VENV_PATH=/opt/venv
RUN poetry export --without-hashes > requirements.txt \
&& . /opt/venv/bin/activate \
&& pip install -r requirements.txt --no-cache-dir
FROM ghcr.io/flibusta-apps/base_docker_images:3.11-postgres-runtime AS runtime-image
WORKDIR /app
ENV VENV_PATH=/opt/venv
ENV PATH="$VENV_PATH/bin:$PATH"
COPY ./fastapi_book_server/ /app/
COPY ./scripts/* /root/
COPY --from=build-image $VENV_PATH $VENV_PATH
EXPOSE 8080
HEALTHCHECK CMD python3 /root/healthcheck.py
CMD bash /root/start.sh