-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (18 loc) 路 651 Bytes
/
Copy pathDockerfile
File metadata and controls
22 lines (18 loc) 路 651 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM rust:latest AS builder
RUN rustup target add x86_64-unknown-linux-musl
RUN apt update && apt install -y musl-tools musl-dev
RUN apt-get install -y build-essential
RUN yes | apt install gcc-x86-64-linux-gnu
WORKDIR /app
COPY ./ .
ENV RUSTFLAGS='-C linker=x86_64-linux-gnu-gcc'
RUN cargo build --target x86_64-unknown-linux-musl --release
FROM scratch
ENV ROCKET_ADDRESS=0.0.0.0
ENV ROCKET_PORT=8000
# Replace if you are making a real service
ENV ROCKET_SECRET_KEY="shhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"
EXPOSE 8000
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/hello_rocket ./
CMD ["/app/hello_rocket"]