diff --git a/Dockerfile b/Dockerfile index 5049f57..b554bc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ -FROM ekidd/rust-musl-builder:latest as builder -WORKDIR /home/rust/src +FROM rust:1.67.0-alpine3.17 as builder +WORKDIR /app +RUN apk update +RUN apk add --no-cache musl-dev COPY Cargo.toml Cargo.toml RUN mkdir -p src/ RUN echo "fn main() {println!(\"failed to build\")}" > src/main.rs @@ -8,14 +10,14 @@ RUN rm -f target/release/deps/rustypaste* COPY . . RUN cargo build --locked --release RUN mkdir -p build-out/ -RUN cp target/x86_64-unknown-linux-musl/release/rustypaste build-out/ +RUN cp target/release/rustypaste build-out/ RUN strip build-out/rustypaste FROM scratch WORKDIR /app COPY --from=builder \ - /home/rust/src/build-out/rustypaste \ - /home/rust/src/config.toml ./ + /app/build-out/rustypaste \ + /app/config.toml ./ ENV SERVER__ADDRESS=0.0.0.0:8000 EXPOSE 8000 USER 1000:1000