-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
45 lines (34 loc) · 1.03 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
44
45
# Use the official Node.js image as the base image with Node.js version 18
FROM node:18
# Set the working directory inside the container
WORKDIR /app
# Install required dependencies for mediasoup
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-minimal \
build-essential \
pkg-config \
openssl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /tmp/*
# SSL 디렉토리 생성
RUN mkdir -p /app/ssl
# Copy package files
COPY package*.json ./
# Install Node.js dependencies
RUN npm ci --only=production && \
npm cache clean --force
# Copy the rest of the application code
COPY . .
# Add healthcheck endpoint for ALB
COPY healthcheck.js ./
# SSL 인증서 생성
RUN openssl req -x509 -newkey rsa:2048 -keyout /app/ssl/key.pem -out /app/ssl/crt.pem -days 365 -nodes -subj "/CN=mediasoup"
# Expose the main server port
EXPOSE 8000
# Expose WebRTC ports (as defined in createWorker)
EXPOSE 2000-2020/udp
EXPOSE 2000-2020/tcp
# Start the server
CMD ["node", "server.js"]