Skip to content

Commit

Permalink
Log backtrace
Browse files Browse the repository at this point in the history
  • Loading branch information
ubergeek77 authored Jun 7, 2024
1 parent 3b50791 commit 1ad9c72
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile-backend
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# syntax=docker/dockerfile:1.6
# syntax=docker/dockerfile:1.7
ARG RUST_VERSION=1.78
ARG CARGO_BUILD_FEATURES=default
ARG RUST_RELEASE_MODE=release
Expand All @@ -15,6 +15,7 @@ FROM ${BUILDER_IMAGE} AS build

ARG CARGO_BUILD_FEATURES
ARG RUST_RELEASE_MODE
ARG RUSTFLAGS

WORKDIR /lemmy

Expand All @@ -23,16 +24,15 @@ COPY . ./
# Debug build
RUN --mount=type=cache,target=/lemmy/target set -ex; \
if [ "${RUST_RELEASE_MODE}" = "debug" ]; then \
echo "pub const VERSION: &str = \"$(git describe --tag)\";" > crates/utils/src/version.rs; \
cargo build --features "${CARGO_BUILD_FEATURES}"; \
RUST_BACKTRACE=1 cargo build --features "${CARGO_BUILD_FEATURES}"; \
mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \
fi

# Release build
RUN --mount=type=cache,target=/lemmy/target set -ex; \
if [ "${RUST_RELEASE_MODE}" = "release" ]; then \
cargo clean --release; \
cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
RUST_BACKTRACE=1 cargo build --features "${CARGO_BUILD_FEATURES}" --release; \
mv target/"${RUST_RELEASE_MODE}"/lemmy_server ./lemmy_server; \
fi

Expand Down

0 comments on commit 1ad9c72

Please sign in to comment.