-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile-server.prod
50 lines (40 loc) · 1.89 KB
/
Dockerfile-server.prod
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
FROM dgarcia254/debian8-node7-pm2-transmission-clamav:latest
LABEL maintaner "Daniel Garcia - [email protected]"
#Set ENV vars
ENV BACK_DIR /usr/src/app
#Create 'test' user
RUN adduser --shell /bin/bash --disabled-password --gecos "" demo && \
mkdir /home/demo/downloads && \
chmod -R 0777 /home/demo/downloads && \
chown demo:demo -R /home/demo/downloads
#Create 'dgarcia' user
RUN adduser --shell /bin/bash --disabled-password --gecos "" dgarcia && \
mkdir /home/dgarcia/downloads && \
chmod -R 0777 /home/dgarcia/downloads && \
chown dgarcia:dgarcia -R /home/dgarcia/downloads
#Create 'elenagp' user
RUN adduser --shell /bin/bash --disabled-password --gecos "" elenagp && \
mkdir /home/elenagp/downloads && \
chmod -R 0777 /home/elenagp/downloads && \
chown elenagp:elenagp -R /home/elenagp/downloads
#Config Transmissio torrent client
RUN service transmission-daemon stop && \
sed -i 's/9091/9090/g' /etc/transmission-daemon/settings.json && \
sed -i 's/"rpc-username": "transmission"/"rpc-username": "truser"/g' /etc/transmission-daemon/settings.json && \
sed -i 's/"rpc-password": "transmission"/"rpc-password": "trpwd"/g' /etc/transmission-daemon/settings.json && \
sed -i 's/127\.0\.0\.1/\*\.\*\.\*\.\*/g' /etc/transmission-daemon/settings.json && \
sed -i 's/"umask": 18/"umask": 2/g' /etc/transmission-daemon/settings.json && \
service transmission-daemon start && \
usermod -a -G debian-transmission demo && \
usermod -a -G debian-transmission dgarcia && \
usermod -a -G debian-transmission elenagp
#Set the server work directory
RUN mkdir -p /usr/src/app
WORKDIR ${BACK_DIR}
#Add our package.json and install *before* adding our server app files
ADD server/package.json ./
RUN npm install --silent
#Copy rest of the server files and config env
COPY server /usr/src/app/
#Start service
CMD ["/bin/bash","start.sh","prod"]