-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (20 loc) · 1.01 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (20 loc) · 1.01 KB
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
# ── Stage 1: build ─────────────────────────────────────────────────────────
FROM rust:slim AS builder
WORKDIR /app
# Copy the server workspace into the build container
COPY server/ .
RUN cargo build --release --bin linkly
# ── Stage 2: runtime ───────────────────────────────────────────────────────
FROM debian:bookworm-slim
# ca-certificates is needed by reqwest/rustls to verify TLS when doing
# IP geolocation lookups
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/linkly /app/linkly
# The data directory is where the SQLite database lives.
# Mount a persistent volume here to survive container restarts.
RUN mkdir -p /data
EXPOSE 8080
CMD ["/app/linkly"]