Skip to content

Commit 595c729

Browse files
committed
Enhance Dockerfile for improved build process
- Added a command to copy the built `spacebot` binary to the appropriate directory after the build. - Updated the Dockerfile to reflect the new path for the `spacebot` binary during the slim stage.
1 parent 5496f8f commit 595c729

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ COPY src/ src/
4848
RUN --mount=type=cache,target=/usr/local/cargo/registry \
4949
--mount=type=cache,target=/usr/local/cargo/git \
5050
--mount=type=cache,target=/build/target \
51-
SPACEBOT_SKIP_FRONTEND_BUILD=1 cargo build --release
51+
SPACEBOT_SKIP_FRONTEND_BUILD=1 cargo build --release \
52+
&& cp /build/target/release/spacebot /usr/local/bin/spacebot
5253

5354
# ---- Slim stage ----
5455
# Minimal runtime with just the binary. No browser.
@@ -60,7 +61,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6061
curl \
6162
&& rm -rf /var/lib/apt/lists/*
6263

63-
COPY --from=builder /build/target/release/spacebot /usr/local/bin/spacebot
64+
COPY --from=builder /usr/local/bin/spacebot /usr/local/bin/spacebot
6465
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
6566
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
6667

0 commit comments

Comments
 (0)