forked from opencast/pyCA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (62 loc) · 1.57 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
FROM alpine:3.13 AS build
RUN apk --no-cache add \
curl-dev \
g++ \
gcc \
linux-headers \
make \
musl-dev \
nodejs \
npm \
py3-pip \
python3 \
python3-dev \
util-linux \
&& ln -s /usr/bin/python3 /usr/bin/python
WORKDIR /usr/local/src
COPY requirements.txt package.json package-lock.json ./
RUN pip install -r requirements.txt \
&& npm i
COPY . .
RUN make pypi
FROM alpine:3.13
LABEL maintainer="pyCA team"
COPY --from=build /usr/local/src/dist/pyca-*.tar.gz /tmp/pyca.tar.gz
RUN apk --no-cache --virtual .run-deps add \
libcurl \
postgresql-libs \
py3-pip \
python3 \
&& apk --no-cache --virtual .build-deps add \
curl \
curl-dev \
g++ \
gcc \
linux-headers \
make \
musl-dev \
postgresql-dev \
python3-dev \
tar \
xz \
&& ln -s /usr/bin/python3 /usr/bin/python \
&& pip install \
/tmp/pyca.tar.gz \
gunicorn \
psycopg2 \
&& cd /usr/local/bin \
&& curl -sSL "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" \
| tar xJf - --strip-components 1 --wildcards '*/ffmpeg' '*/ffprobe' \
&& apk del .build-deps \
&& rm -rf /tmp/pyca.tar.gz
RUN addgroup -S -g 800 pyca \
&& adduser -S -D -h /var/lib/pyca -G pyca -u 800 pyca \
&& addgroup pyca audio \
&& addgroup pyca video
COPY etc/pyca.conf etc/gunicorn.conf.py /etc/pyca/
RUN echo 'bind = "0.0.0.0:8000"' >> /etc/pyca/gunicorn.conf.py
WORKDIR /var/lib/pyca
USER pyca
VOLUME [ "/var/lib/pyca" ]
EXPOSE 8000
ENTRYPOINT [ "pyca" ]