forked from butorenjin/easyrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (32 loc) · 1.04 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
# Pull base image.
FROM node:latest
MAINTAINER Harold Thetiot <[email protected]>
# Upgrade npm
RUN npm i npm@latest -g
ENV NO_UPDATE_NOTIFIER 1
# Create app directory
ENV APPDIR /usr/src/app
RUN mkdir -p $APPDIR
WORKDIR $APPDIR
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
ADD package*.json $APPDIR/
RUN npm install
# Install dependencies in production mode (no dev dependencies).
ARG EASYRTC_BRANCH=master
RUN npm install priologic/easyrtc#$EASYRTC_BRANCH
RUN npm install --production
ADD . $APPDIR
VOLUME ['certs', 'static']
# Replace 'easyrtc = require("..");' by 'easyrtc = require("easyrtc");''
# To use easyrtc from node_modules instead of parent directory
RUN sed -i "s|easyrtc = require(\"../\")|easyrtc = require(\"easyrtc\")|g" $APPDIR/*.js
# Define service user
RUN chown -R nobody:nogroup $APPDIR && chmod -R a-w $APPDIR && ls -ld
USER nobody
# Ports > 1024 since we're not root.
EXPOSE 8080 8443
ENV SYLAPS_ENV all
ENTRYPOINT ["npm"]
CMD ["start"]