2020-11-23 15:49:05 +01:00
|
|
|
FROM node:14-alpine
|
2020-05-26 20:03:42 +02:00
|
|
|
|
2020-10-29 17:49:34 +01:00
|
|
|
RUN apk add git \
|
|
|
|
&& adduser -D -u 2004 -g webrtc-sfu webrtc-sfu
|
2020-04-12 20:20:50 +02:00
|
|
|
|
|
|
|
ADD . app
|
|
|
|
|
|
|
|
WORKDIR app
|
|
|
|
|
|
|
|
ENV NODE_ENV production
|
|
|
|
|
|
|
|
|
|
|
|
# due to the git submodule npm install crashes with following error:
|
|
|
|
# npm ERR! fatal: Not a git repository: ../.git/modules/bbb-webrtc-sfu
|
|
|
|
# we simply delete the .git file
|
|
|
|
RUN cp config/default.example.yml config/production.yml \
|
2020-10-29 17:49:34 +01:00
|
|
|
&& chown -R webrtc-sfu:webrtc-sfu config \
|
2020-04-12 20:20:50 +02:00
|
|
|
&& rm .git \
|
|
|
|
&& npm install --unsafe-perm \
|
|
|
|
&& npm cache clear --force
|
|
|
|
|
|
|
|
|
2020-05-31 11:49:57 +02:00
|
|
|
# remove automatic IP detection (broken in alpine)
|
|
|
|
# and use sh instead of bash
|
|
|
|
RUN sed -i 's/CONTAINER_IP=.*/CONTAINER_IP=10.7.7.10/' /app/docker-entrypoint.sh \
|
|
|
|
&& sed -i 's/bash/sh/' /app/docker-entrypoint.sh
|
|
|
|
|
2020-10-29 17:49:34 +01:00
|
|
|
USER webrtc-sfu
|
2020-04-12 20:20:50 +02:00
|
|
|
ENTRYPOINT [ "./docker-entrypoint.sh" ]
|
|
|
|
CMD [ "npm", "start" ]
|