mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Compare commits
1 Commits
main
...
feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
| 95d5c8f511 |
8
.github/workflows/build_docker_image.yml
vendored
8
.github/workflows/build_docker_image.yml
vendored
@@ -13,12 +13,6 @@ jobs:
|
|||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2
|
|
||||||
with:
|
|
||||||
platforms: arm64
|
|
||||||
|
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
@@ -44,7 +38,7 @@ jobs:
|
|||||||
IMAGE: ${{ steps.repository_name.outputs.lowercase }}
|
IMAGE: ${{ steps.repository_name.outputs.lowercase }}
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64
|
||||||
tags: ghcr.io/${{ env.IMAGE }}:latest
|
tags: ghcr.io/${{ env.IMAGE }}:latest
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/build.dockerfile
|
file: ./docker/build.dockerfile
|
||||||
|
|||||||
@@ -1,29 +1,21 @@
|
|||||||
FROM ghcr.io/flibusta-apps/base_docker_images:3.11-postgres-asyncpg-poetry-buildtime AS build-image
|
FROM rust:bullseye AS builder
|
||||||
|
|
||||||
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
|
WORKDIR /app
|
||||||
|
|
||||||
ENV VENV_PATH=/opt/venv
|
COPY . .
|
||||||
ENV PATH="$VENV_PATH/bin:$PATH"
|
|
||||||
|
|
||||||
COPY ./fastapi_book_server/ /app/
|
RUN cargo build --release --bin book_library_server
|
||||||
COPY ./scripts/* /root/
|
|
||||||
|
|
||||||
COPY --from=build-image $VENV_PATH $VENV_PATH
|
|
||||||
|
|
||||||
EXPOSE 8080
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
HEALTHCHECK CMD python3 /root/healthcheck.py
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y openssl ca-certificates \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
CMD bash /root/start.sh
|
RUN update-ca-certificates
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --from=builder /app/target/release/book_library_server /usr/local/bin
|
||||||
|
ENTRYPOINT ["/usr/local/bin/book_library_server"]
|
||||||
|
|||||||
Reference in New Issue
Block a user