Skip to content

Commit 5dd1f99

Browse files
committed
COPY local source files for building instead of using git clone
1 parent 40aa181 commit 5dd1f99

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docker/server/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ WORKDIR /app
66

77
# Install build dependencies required by reqwest/rustls toolchain.
88
RUN apt-get update \
9-
&& apt-get install -y --no-install-recommends pkg-config libssl-dev build-essential git \
9+
&& apt-get install -y --no-install-recommends pkg-config libssl-dev build-essential \
1010
&& rm -rf /var/lib/apt/lists/*
1111

12-
RUN git clone https://github.com/second-state/echokit_server.git
13-
RUN cd echokit_server \
14-
&& cargo build --release
12+
COPY . .
13+
14+
RUN cargo build --release
1515

1616

1717
FROM debian:bookworm-slim AS runtime
@@ -22,8 +22,8 @@ RUN apt-get update \
2222

2323
WORKDIR /app
2424

25-
COPY --from=builder /app/echokit_server/config.toml .
26-
COPY --from=builder /app/echokit_server/target/release/echokit_server /usr/local/bin/echokit_server
25+
COPY --from=builder /app/config.toml .
26+
COPY --from=builder /app/target/release/echokit_server /usr/local/bin/echokit_server
2727

2828
ENV RUST_LOG=info
2929

docker/server/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This directory contains a multi-stage Dockerfile for producing a lean runtime image of `echokit_server`.
44

5-
- **Builder stage** (`rust:1.85-slim`): installs the minimal Rust toolchain dependencies, clones `https://github.com/second-state/echokit_server`, and compiles the project in release mode.
5+
- **Builder stage** (`rust:1.85-slim`): installs the minimal Rust toolchain dependencies, copies the repository contents into `/app`, and compiles the project in release mode.
66
- **Runtime stage** (`debian:bookworm-slim`): installs the required runtime libraries, copies the compiled binary and default `config.toml`, and sets `RUST_LOG=info` before starting the server with that config.
77

88
## Run
@@ -22,13 +22,13 @@ Place `config.toml` and `hello.wav` inside the mounted `config` directory so the
2222
## Build
2323

2424
```sh
25-
docker build -t secondstate/echokit:latest-server .
25+
docker build -t secondstate/echokit:latest-server -f docker/server/Dockerfile .
2626
```
2727

2828
## Multi-platform build
2929

3030
```sh
31-
docker buildx build . --platform linux/arm64,linux/amd64 --tag secondstate/echokit:latest-server -f Dockerfile
31+
docker buildx build . --platform linux/arm64,linux/amd64 --tag secondstate/echokit:latest-server -f docker/server/Dockerfile
3232
```
3333

3434
## Publish

0 commit comments

Comments
 (0)