-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (29 loc) · 815 Bytes
/
Dockerfile
File metadata and controls
43 lines (29 loc) · 815 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
40
41
42
43
# Build stage
FROM rust:1.95-alpine AS builder
# Add build dependencies
RUN apk add --no-cache musl-dev pkgconfig
WORKDIR /app
COPY . .
# Build the application
RUN cargo build --release
# Run stage
FROM alpine:3.23
# Set Time Zone to IST
ENV TZ="Asia/Kolkata"
# Add required runtime packages
RUN apk add --no-cache curl ca-certificates tzdata
# Set Working Directory
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/target/release/netviz /app/netviz
# Copy templates
COPY templates /app/templates
# Add user
RUN addgroup -S netvizgroup && adduser -S netvizuser -G netvizgroup
# Create data directory and set permissions
RUN mkdir -p /app/data/peeringdb && chown -R netvizuser:netvizgroup /app
# Switch to the non-root user
USER netvizuser
# Expose Port
EXPOSE 8201
CMD ["/app/netviz"]