-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
65 lines (52 loc) · 1.97 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
FROM alpine:3.20 AS base
# hadolint ignore=DL3018
RUN echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && \
apk upgrade --no-cache --purge --latest --prune && \
apk add --no-cache --purge --latest --upgrade \
curl \
ffmpeg \
logrotate \
motion@testing \
nginx \
openssl \
python3 \
v4l-utils \
tzdata \
&& rm -rf /var/cache/apk/* && find / -depth -regex '^.*\(__pycache__\|\.py[co]\)$' -delete
FROM base AS build
# hadolint ignore=DL3018
RUN apk add --no-cache --purge --latest --upgrade \
build-base \
curl-dev \
libjpeg-turbo-dev \
python3-dev \
&& rm -rf /var/cache/apk/*
# hadolint ignore=DL3013,SC1091
RUN python3 -m venv --symlinks /motioneye && \
. /motioneye/bin/activate && \
pip install --isolated --no-cache-dir --no-compile --no-input --prefer-binary --upgrade pip setuptools wheel && \
pip install --isolated --no-cache-dir --no-compile --no-input --prefer-binary --upgrade --pre motioneye && \
pip uninstall --isolated --no-cache-dir --no-input --yes pip setuptools wheel && \
find / -depth -regex '^.*\(__pycache__\|\.py[co]\)$' -delete && \
find /motioneye -iname '*.so' -exec strip '{}' \;
FROM base AS motioneye
LABEL maintainer="Chris 'sh0shin' Frage <[email protected]>"
RUN mkdir -p /etc/motioneye /var/lib/motioneye /var/log/motioneye /var/run/motioneye && \
chown -R motion:motion /etc/motioneye /var/lib/motioneye /var/log/motioneye /var/run/motioneye && \
rm /etc/nginx/http.d/default.conf && mkdir -p /var/lib/nginx/ssl
COPY --chown=motion:motion --from=build /motioneye /motioneye
COPY nginx-motioneye.conf /motioneye/nginx-motioneye.conf
COPY nginx-motioneye-ssl.conf /motioneye/nginx-motioneye-ssl.conf
COPY logrotate-nginx /etc/logrotate.d/nginx
#COPY logrotate-motioneye /etc/logrotate.d/motioneye
COPY entrypoint.sh /entrypoint.sh
VOLUME /etc/motioneye
VOLUME /var/lib/motioneye
VOLUME /var/lib/nginx/ssl
VOLUME /var/log/motioneye
VOLUME /var/log/nginx
EXPOSE 8080
EXPOSE 8443
EXPOSE 8765
ENTRYPOINT ["/entrypoint.sh"]