forked from prodzilla/prodzilla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 984 Bytes
/
Dockerfile
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
# syntax=docker/dockerfile:1
ARG RUST_VERSION=1.78
FROM --platform=$BUILDPLATFORM rust:${RUST_VERSION}-slim-bookworm AS build
WORKDIR /app
RUN apt-get update -y && apt-get install -y libssl-dev pkg-config
COPY . .
RUN cargo build --locked --release --target-dir target && cp ./target/release/prodzilla /bin/prodzilla
FROM debian:bookworm-slim AS final
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/go/dockerfile-user-best-practices/
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser
USER appuser
# Copy the executable from the "build" stage.
COPY --from=build /bin/prodzilla /bin/
# Expose the port that the application listens on.
EXPOSE 3000
# What the container should run when it is started.
ENTRYPOINT ["/bin/prodzilla"]