mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 07:05:36 +01:00
Compare commits
1 Commits
dependabot
...
feature/re
| Author | SHA1 | Date | |
|---|---|---|---|
| 95d5c8f511 |
12
.github/workflows/build_docker_image.yml
vendored
12
.github/workflows/build_docker_image.yml
vendored
@@ -13,12 +13,6 @@ jobs:
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
platforms: arm64
|
||||
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
@@ -30,7 +24,7 @@ jobs:
|
||||
|
||||
-
|
||||
name: Login to ghcr.io
|
||||
uses: docker/login-action@v2
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
@@ -44,12 +38,12 @@ jobs:
|
||||
IMAGE: ${{ steps.repository_name.outputs.lowercase }}
|
||||
with:
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64
|
||||
tags: ghcr.io/${{ env.IMAGE }}:latest
|
||||
context: .
|
||||
file: ./docker/build.dockerfile
|
||||
|
||||
-
|
||||
-
|
||||
name: Invoke deployment hook
|
||||
uses: joelwmale/webhook-action@master
|
||||
with:
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
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
|
||||
FROM rust:bullseye AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV VENV_PATH=/opt/venv
|
||||
ENV PATH="$VENV_PATH/bin:$PATH"
|
||||
COPY . .
|
||||
|
||||
COPY ./fastapi_book_server/ /app/
|
||||
COPY ./scripts/* /root/
|
||||
RUN cargo build --release --bin book_library_server
|
||||
|
||||
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