-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (29 loc) · 1023 Bytes
/
Dockerfile
File metadata and controls
39 lines (29 loc) · 1023 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
# ---------- Build stage ----------
FROM docker.io/library/rust:1.82-slim as builder
# Instaliraj potrebne sistemske pakete
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Postavi radni direktorijum
WORKDIR /app
# Kopiraj fajlove u kontejner
COPY . .
# Build aplikaciju u release modu
RUN cargo build --release
# ---------- Runtime stage ----------
FROM debian:bookworm-slim
# Instaliraj potrebne runtime pakete
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
# Postavi radni direktorijum
WORKDIR /app
# Kopiraj binarku i potrebne resurse iz build stage-a
COPY --from=builder /app/target/release/statuspulse .
COPY --from=builder /app/static ./static
COPY --from=builder /app/src/templates ./src/templates
COPY --from=builder /app/src/services/email_templates ./src/services/email_templates
# Izloži port koji koristi aplikacija
EXPOSE 3000
# Startuj aplikaciju
CMD ["./statuspulse"]