2021-11-27 17:38:40 +01:00
|
|
|
FROM node:14-bullseye-slim
|
2020-05-26 20:03:42 +02:00
|
|
|
|
2021-11-27 17:38:40 +01:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get -y install \
|
|
|
|
git \
|
|
|
|
make \
|
|
|
|
python \
|
|
|
|
python3-pip \
|
|
|
|
g++ \
|
|
|
|
ffmpeg
|
|
|
|
|
|
|
|
RUN useradd --uid 2004 --user-group webrtc-sfu
|
2020-04-12 20:20:50 +02:00
|
|
|
|
2021-02-11 20:17:42 +01:00
|
|
|
ADD ./bbb-webrtc-sfu app
|
2020-04-12 20:20:50 +02:00
|
|
|
|
|
|
|
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 \
|
2021-11-27 17:38:40 +01:00
|
|
|
&& npm cache clear --force \
|
|
|
|
&& rm -rf node_modules/mediasoup/worker/out/Release/subprojects \
|
|
|
|
&& rm -rf node_modules/mediasoup/worker/out/Release/mediasoup-worker.p \
|
|
|
|
&& rm -rf node_modules/mediasoup/worker/out/Release/deps
|
2021-02-11 20:17:42 +01:00
|
|
|
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
|
2020-05-31 11:49:57 +02:00
|
|
|
|
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" ]
|