mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
24 lines
647 B
Docker
24 lines
647 B
Docker
FROM rust:1.56.1 as builder
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
WORKDIR /app/backend
|
|
ENV SQLX_OFFLINE true
|
|
RUN RUSTFLAGS="-C opt-level=2" cargo build --release --bin backend
|
|
# Size optimization
|
|
#RUN strip ./target/release/backend
|
|
|
|
FROM debian:bullseye-slim AS runtime
|
|
WORKDIR /app
|
|
RUN apt-get update -y \
|
|
&& apt-get install -y --no-install-recommends openssl \
|
|
# Clean up
|
|
&& apt-get autoremove -y \
|
|
&& apt-get clean -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /app/backend/target/release/backend /usr/local/bin/backend
|
|
COPY --from=builder /app/backend/configuration configuration
|
|
ENV APP_ENVIRONMENT production
|
|
CMD ["backend"]
|