-
-
Notifications
You must be signed in to change notification settings - Fork 340
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
69ced47
commit db25883
Showing
2 changed files
with
22 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
FROM node:18-slim | ||
# Use a lightweight Node.js image | ||
FROM node:20-slim | ||
|
||
# Set working directory | ||
WORKDIR /src | ||
|
||
# https://mediasoup.org/documentation/v3/mediasoup/installation/ | ||
# Set environment variable to skip downloading prebuilt workers | ||
ENV MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD="true" | ||
|
||
# Install necessary system packages and dependencies | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
python3 \ | ||
python3-pip \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy package.json and install npm dependencies | ||
COPY package.json . | ||
RUN npm install | ||
|
||
RUN \ | ||
DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
apt-get install -y --no-install-recommends build-essential python3-pip && \ | ||
npm install && \ | ||
apt-get -y purge --auto-remove build-essential python3-pip && \ | ||
apt-get install -y --no-install-recommends python3 && \ | ||
npm cache clean --force && \ | ||
rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/* /usr/share/doc/* | ||
# Cleanup unnecessary packages and files | ||
RUN apt-get purge -y --auto-remove build-essential python3-pip \ | ||
&& npm cache clean --force \ | ||
&& rm -rf /tmp/* /var/tmp/* /usr/share/doc/* | ||
|
||
# Copy the application code | ||
COPY app app | ||
COPY public public | ||
|
||
CMD npm start | ||
# Set default command to start the application | ||
CMD ["npm", "start"] |