-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (21 loc) · 909 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (21 loc) · 909 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
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2026 Hanagram-web contributors
FROM ghcr.io/rust-cross/rust-musl-cross:x86_64-musl AS builder
WORKDIR /app
COPY Cargo.toml ./
COPY Cargo.lock ./
COPY src ./src
COPY templates ./templates
COPY vendor ./vendor
RUN cargo build --release --locked --bin hanagram-web --bin reset_admin
FROM scratch
WORKDIR /app
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/hanagram-web ./hanagram-web
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/reset_admin ./reset_admin
ENV BIND_ADDR=0.0.0.0:8080
ENV SESSIONS_DIR=./sessions
ENV RUST_LOG=info
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD ["/app/hanagram-web", "healthcheck", "http://127.0.0.1:8080/health"]
CMD ["/app/hanagram-web"]