-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (19 loc) · 750 Bytes
/
Dockerfile
File metadata and controls
27 lines (19 loc) · 750 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
FROM rust:alpine3.18 AS build
RUN cargo search --limit 1 && \
apk add --no-cache musl-dev pkgconfig openssl-dev
WORKDIR /app
COPY . .
RUN cargo build --release
FROM alpine:3.18
ARG RUNNER_GROUP_ID=1000
ENV RUNNER_GROUP_ID=${RUNNER_GROUP_ID}
ARG RUNNER_USER_ID=1000
ENV RUNNER_USER_ID=${RUNNER_USER_ID}
ENV APP=lupt
ENV RUST_LOG="actix_web=info"
USER ${RUNNER_USER_ID}:${RUNNER_GROUP_ID}
WORKDIR /app
COPY --from=build --chown=${RUNNER_USER_ID}:${RUNNER_GROUP_ID} /app/target/release/${APP} app
COPY --from=build --chown=${RUNNER_USER_ID}:${RUNNER_GROUP_ID} /app/static static/
COPY --from=build --chown=${RUNNER_USER_ID}:${RUNNER_GROUP_ID} [ "/app/.config.json", "config.json" ]
CMD RUST_LOG="${RUST_LOG}" ./app --config-file config.json