-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (29 loc) · 718 Bytes
/
Dockerfile
File metadata and controls
45 lines (29 loc) · 718 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
44
45
FROM rust:1.91-bullseye AS builder
WORKDIR /app
ARG service
ARG features
COPY . .
RUN cargo build --release
FROM debian:bullseye-slim AS runtime
ARG service
ENV USER=hcloud
ENV UID=42069
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
# Install ca-certificates for HTTPS support
RUN apt-get update
RUN apt-get install -y ca-certificates
RUN rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/gitlab_hcloud /app/app
RUN chown -R "${USER}:${USER}" /app
# Use the flexi user
USER hcloud:hcloud
# Set entrypoint to run backend
ENTRYPOINT ["/app/app"]