-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathDockerfile
67 lines (51 loc) · 1.8 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM alpine:3.20 AS build
ARG VERSION
RUN apk --no-cache --repository community add \
dotnet8-sdk \
jq==1.7.1-r0
# Copy source code
COPY ["OF DL.sln", "/src/OF DL.sln"]
COPY ["OF DL", "/src/OF DL"]
WORKDIR "/src"
# Build release
RUN dotnet publish -p:WarningLevel=0 -p:Version=$VERSION -c Release --self-contained true -p:PublishSingleFile=true -o out
# Generate default auth.json and config.json files
RUN /src/out/OF\ DL --non-interactive || true && \
# Set download path in default config.json to /data
jq '.DownloadPath = "/data"' /src/config.json > /src/updated_config.json && \
mv /src/updated_config.json /src/config.json
FROM alpine:3.20 AS final
# Install dependencies
RUN apk --no-cache --repository community add \
bash \
tini \
dotnet8-runtime \
ffmpeg \
udev \
ttf-freefont \
chromium \
supervisor \
xvfb \
x11vnc \
novnc
# Redirect webroot to vnc.html instead of displaying directory listing
RUN echo "<!DOCTYPE html><html><head><meta http-equiv=\"Refresh\" content=\"0; url='vnc.html'\" /></head><body></body></html>" > /usr/share/novnc/index.html
# Copy release
COPY --from=build /src/out /app
# Create directories for configuration and downloaded files
RUN mkdir /data /config /config/logs /default-config
# Copy default configuration files
COPY --from=build /src/config.json /default-config
COPY --from=build ["/src/OF DL/rules.json", "/default-config"]
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY docker/entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENV DISPLAY=:0.0 \
DISPLAY_WIDTH=1024 \
DISPLAY_HEIGHT=768 \
OFDL_PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium \
OFDL_DOCKER=true
EXPOSE 8080
WORKDIR /config
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/app/entrypoint.sh"]