-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
47 lines (37 loc) · 1.21 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
FROM ubuntu:18.04
LABEL Maintainer="Michael Riha <[email protected]> (rihabitmovin/cmafbroadcaster)"
RUN apt-get update && apt-get install -y \
sudo \
python-minimal \
python-pip \
wget \
apache2 \
apache2-dev
#apache2-utils
#&& mkdir /tmp
#https://vsupalov.com/docker-arg-env-variable-guide/
ENV OUTPUT_FOLDER="/out"
ENV STREAM="with_audio"
COPY install_scripts /tmp
COPY test_scripts /tmp
COPY server /srv
# https://stackoverflow.com/questions/27701930/add-user-to-docker-container wsgi can not run as root!
RUN useradd -ms /bin/bash wsgi \
&& sudo adduser wsgi sudo \
&& chown wsgi:wsgi -R tmp \
&& chmod -R +x tmp \
&& chown wsgi:wsgi -R /srv \
&& passwd wsgi -d \
#even create the output
&& sudo mkdir $OUTPUT_FOLDER \
&& sudo chown wsgi:wsgi -R $OUTPUT_FOLDER \
&& sudo chmod g+rw -R $OUTPUT_FOLDER \
&& ls -la $OUTPUT_FOLDER
VOLUME ["/out"]
VOLUME ["/tmp/test_scripts/playlists"]
RUN sh /tmp/install.sh # install ffmpeg prebuild and python stuff
#https://stackoverflow.com/questions/25845538/how-to-use-sudo-inside-a-docker-container
USER wsgi
# Make port 8000 available to the world outside this container
EXPOSE 8000
ENTRYPOINT ["/tmp/startServer.sh"]