-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (24 loc) · 665 Bytes
/
Dockerfile
File metadata and controls
40 lines (24 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# build stage
FROM rust:latest as builder
WORKDIR /workspace
RUN apt-get update && apt-get install lld clang -y
COPY . .
RUN cargo build --release
# deploy stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends openssl ca-certificates && apt-get clean
# create workspace directory
WORKDIR /workspace
COPY static static
COPY settings settings
COPY scripts/run .
# copy app bin
COPY --from=builder /workspace/target/release/app .
# copy migration bin
COPY --from=builder /workspace/target/release/migration .
# expose port
EXPOSE 8080
ENV APP_PROFILE prod
ENV RUST_LOG info
# run the app
ENTRYPOINT ["./run"]