Skip to content

Commit 9643c4b

Browse files
committed
Updated Dockerfile (closes #4)
1 parent 773ec7b commit 9643c4b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Stage 1: Build the application
2-
FROM rust:latest as builder
2+
FROM rust:bookworm as builder
33

44
WORKDIR /usr/src/app
55

@@ -14,7 +14,11 @@ RUN cargo build --release
1414

1515

1616
# Stage 2: Create a lightweight production image
17-
FROM alpine:latest
17+
FROM debian:bookworm-slim
18+
19+
RUN apt-get update && apt-get upgrade -y && apt-get install -y openssl
20+
21+
RUN adduser --system --group rcp
1822

1923
WORKDIR /usr/src/app
2024

@@ -27,5 +31,8 @@ ENV LOGGING_ENABLED true
2731
# Expose the desired port
2832
EXPOSE 8080
2933

34+
# Change the user to the non-root user
35+
USER rcp
36+
3037
# Start the application
31-
CMD ["./rcp"]
38+
CMD ["./rcp"]

0 commit comments

Comments
 (0)