-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
32 lines (23 loc) · 958 Bytes
/
Dockerfile
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
FROM rust:1.83-slim as builder
WORKDIR /kz
RUN rustup toolchain install nightly-2025-01-08
COPY Cargo.toml Cargo.lock .
COPY .example.env .example.env
COPY .cargo .cargo
COPY rust-toolchain.toml rust-toolchain.toml
COPY crates crates
COPY .sqlx .sqlx
RUN apt-get update -y && apt-get install -y pkg-config python3 python3.11-dev
ENV SQLX_OFFLINE 1
RUN cargo build --release --locked --package=cs2kz-api --bin=cs2kz-api
FROM debian:bookworm-slim AS runtime
ARG DEPOT_DOWNLOADER_URL
RUN apt-get update -y && apt-get install -y curl unzip libicu-dev pkg-config python3.11-dev
RUN curl -sSLo downloader.zip "$DEPOT_DOWNLOADER_URL" \
&& unzip downloader.zip \
&& rm downloader.zip \
&& chmod +x DepotDownloader \
&& mv DepotDownloader /usr/bin/DepotDownloader
COPY --from=builder /kz/target/release/cs2kz-api /bin/cs2kz-api
ENV RUST_LOG cs2kz=trace,sqlx=debug,warn
ENTRYPOINT ["/bin/cs2kz-api", "--ip", "0.0.0.0", "--config", "/etc/cs2kz-api.toml"]