-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (20 loc) · 788 Bytes
/
Dockerfile
File metadata and controls
31 lines (20 loc) · 788 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
FROM rust:trixie AS chef
RUN cargo install cargo-chef --locked
WORKDIR /usr/src/gitarena
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /usr/src/gitarena/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN cargo build --release
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /usr/src/gitarena/target/release/gitarena /app/gitarena-bin
COPY --from=builder /usr/src/gitarena/gitarena/templates/ /app/gitarena/templates/
COPY --from=builder /usr/src/gitarena/gitarena/static/ /app/gitarena/static/
EXPOSE 8080
ENV BIND_ADDRESS="0.0.0.0:8080"
ENTRYPOINT ["/app/gitarena-bin"]