-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (33 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
45 lines (33 loc) · 1.1 KB
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 Node.js 22 with Debian Buster Slim
FROM node:22-bookworm-slim
# Set working directory
WORKDIR /app
# Copy package.json files first for better layer caching
COPY rtmediaproxy_frontend/package.json rtmediaproxy_frontend/package-lock.json* ./frontend/
COPY rtmediaproxy_server/package.json rtmediaproxy_server/package-lock.json* ./server/
# Install frontend dependencies (including devDependencies for build)
WORKDIR /app/frontend
RUN npm ci
# Install server dependencies
WORKDIR /app/server
RUN npm ci --only=production
# Copy frontend source code
WORKDIR /app
COPY rtmediaproxy_frontend ./frontend/
# Build frontend
WORKDIR /app/frontend
RUN npm run build
# Copy server source code
WORKDIR /app
COPY rtmediaproxy_server ./server/
# Create frontend dist directory in the expected location for the server
RUN mkdir -p /app/server/frontend_dist
RUN cp -r /app/frontend/dist/* /app/server/frontend_dist/
# Set working directory to server
WORKDIR /app/server
# Expose port
EXPOSE 8080
# Set environment variable for frontend root
ENV FRONTEND_ROOT=/app/server/frontend_dist
# Start the server
CMD ["node", "index.js"]