chore: fix docker build

This commit is contained in:
nathan 2024-02-24 10:44:52 +08:00
parent 39323d99ac
commit 0f2df6d352
2 changed files with 6 additions and 5 deletions

View File

@ -91,7 +91,7 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
provenance: false
build-args: |
FEATURES="disable_access_control"
FEATURES=disable_access_control
- name: Logout from Docker Hub
if: always()

View File

@ -1,8 +1,5 @@
FROM lukemathwalker/cargo-chef:latest-rust-1.75.0 as chef
# Build argument for features
ARG FEATURES=""
WORKDIR /app
RUN apt update && apt install lld clang -y
@ -12,6 +9,10 @@ COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef as builder
# Specify a default value for FEATURES; it could be an empty string if no features are enabled by default
ARG FEATURES=""
COPY --from=planner /app/recipe.json recipe.json
# Build our project dependencies
RUN cargo chef cook --release --recipe-path recipe.json
@ -20,7 +21,7 @@ ENV SQLX_OFFLINE true
# Build the project
RUN echo "Building with features: ${FEATURES}"
RUN cargo build --profile=profiling --features=${FEATURES} --bin appflowy_cloud
RUN cargo build --profile=profiling --features "${FEATURES}" --bin appflowy_cloud
FROM debian:bookworm-slim AS runtime