forked from plexinc/pms-docker
/
Dockerfile
78 lines (63 loc) · 2.51 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
68
69
70
71
72
73
74
75
76
77
78
#######################
# Extra builder for healthchecker
#######################
ARG BUILDER_BASE=dubodubonduponey/base:builder
ARG RUNTIME_BASE=dubodubonduponey/base:runtime
# hadolint ignore=DL3006
FROM --platform=$BUILDPLATFORM $BUILDER_BASE AS builder-healthcheck
ARG HEALTH_VER=51ebf8ca3d255e0c846307bf72740f731e6210c3
WORKDIR $GOPATH/src/github.com/dubo-dubon-duponey/healthcheckers
RUN git clone git://github.com/dubo-dubon-duponey/healthcheckers .
RUN git checkout $HEALTH_VER
RUN arch="${TARGETPLATFORM#*/}"; \
env GOOS=linux GOARCH="${arch%/*}" go build -v -ldflags "-s -w" -o /dist/boot/bin/http-health ./cmd/http
#######################
# Running image
#######################
# hadolint ignore=DL3006
FROM $RUNTIME_BASE
WORKDIR /boot/bin
ARG PLEX_VERSION=1.18.3.2156-349e9837e
# XXX verify why this is not set by the base image
ARG TARGETPLATFORM
USER root
ARG DEBIAN_FRONTEND="noninteractive"
ENV TERM="xterm" LANG="C.UTF-8" LC_ALL="C.UTF-8"
# Custom package in
COPY "./cache/$PLEX_VERSION/$TARGETPLATFORM/plex.deb" /tmp
RUN dpkg -i --force-confold /tmp/plex.deb
# All of this is required solely by the init script
RUN apt-get update -qq \
&& apt-get install -qq --no-install-recommends \
curl=7.64.0-4 \
xmlstarlet=1.6.1-2 \
uuid-runtime=2.33.1-0.1 \
dnsutils=1:9.11.5.P4+dfsg-5.1 \
&& apt-get -qq autoremove \
&& apt-get -qq clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* \
&& rm -rf /var/tmp/*
USER dubo-dubon-duponey
# Change home directory for plex
# RUN usermod -d /config plex
# COPY entrypoint.sh .
# Environment
ENV DBDB_LOGIN=""
ENV DBDB_PASSWORD=""
ENV DBDB_MAIL=""
ENV DBDB_ADVERTISE_IP=""
ENV DBDB_SERVER_NAME=""
ENV DBDB_UID=""
ENV DBDB_GID=""
# Ports
EXPOSE 32400/tcp
# Unexposed, because we don't need them
# 3005/tcp 8324/tcp 32469/tcp 1900/udp 32410/udp 32412/udp 32413/udp 32414/udp
# Volumes we need
VOLUME /transcode
VOLUME /data
# VOLUME /certs
# Declare healthcheck
HEALTHCHECK --interval=5s --timeout=2s --retries=20 \
CMD curl --connect-timeout 15 --silent --show-error --fail "http://localhost:32400/identity" >/dev/null || exit 1