forked from Dadoum/anisette-v3-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (31 loc) · 1.16 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (31 loc) · 1.16 KB
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
# Base for builder
FROM debian:stable-20250520-slim AS builder
# Deps for builder
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates ldc git clang dub libz-dev libssl-dev libplist-dev libplist-2.0-4 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Build for builder
WORKDIR /opt/
COPY . .
RUN DC=ldc2 dub build -c "static" --build-mode allAtOnce -b release --compiler=ldc2
# Base for run
FROM debian:stable-slim
RUN apt-get update && apt-get install --no-install-recommends -y ca-certificates curl libplist-dev libplist-2.0-4\
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy build artefacts to run
WORKDIR /opt/
COPY --from=builder /opt/anisette-v3-server /opt/anisette-v3-server
# Create default provisioning folder
RUN mkdir -p /opt/anisette-v3/provisioning
# Setup rootless user which works with the volume mount
RUN useradd -ms /bin/bash Alcoholic \
&& mkdir /home/Alcoholic/.config/anisette-v3/lib/ -p \
&& chown -R Alcoholic /home/Alcoholic/ \
&& chmod -R +wx /home/Alcoholic/ \
&& chown -R Alcoholic /opt/ \
&& chmod -R +wx /opt/
# Run the artefact
USER Alcoholic
EXPOSE 6969
ENTRYPOINT [ "/opt/anisette-v3-server" ]