Skip to content

Commit

Permalink
change dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
rawdaGastan committed Oct 1, 2024
1 parent a82e7be commit 358ac58
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
FROM rust:slim
FROM rust:slim as builder

WORKDIR /src

COPY fl-server /src/fl-server
COPY rfs /src/rfs
COPY docker2fl /src/docker2fl
COPY Cargo.toml .
COPY Cargo.lock .
COPY config.toml .

RUN apt-get update && apt-get install curl build-essential libssl-dev musl-tools -y
RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --bin fl-server --target=x86_64-unknown-linux-musl

WORKDIR /myapp
FROM alpine:3.19

COPY . .
WORKDIR /app

RUN rustup target add x86_64-unknown-linux-musl
RUN cargo build --release --target=x86_64-unknown-linux-musl
COPY --from=builder /src/target/x86_64-unknown-linux-musl/release/fl-server .
COPY --from=builder /src/config.toml .

CMD ["/myapp/target/x86_64-unknown-linux-musl/release/fl-server", "--config-path", "config.toml"]
EXPOSE 3000
ENTRYPOINT [ "./fl-server", "--config-path", "config.toml"]

0 comments on commit 358ac58

Please sign in to comment.