-
-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (26 loc) · 819 Bytes
/
Dockerfile
File metadata and controls
33 lines (26 loc) · 819 Bytes
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
# Build stage
FROM node:18-alpine AS builder
# Install build dependencies and build the project
WORKDIR /app
COPY package.json ./
RUN yarn install
COPY . .
RUN yarn build
# Runtime stage
FROM node:18-alpine
# Install runtime dependencies
WORKDIR /app
COPY --from=builder /app/package.json ./
RUN yarn install --production
# Copy built project and .env file from the build stage
COPY --from=builder /app/dist ./dist
# Do not copy .env file, it should be mounted separately
# COPY .env ./
# Expose the server port
EXPOSE 2002
# Start the server
CMD ["node", "dist/src/index.js"]
# CMD ["sh", "-c", "DEBUG= node dist/index.js"]
# Start the server with DEBUG mode enabled
# CMD ["sh", "-c", "DEBUG=socket.io-redis-streams-adapter node dist/index.js"]
# CMD ["sh", "-c", "DEBUG=socket.io-redis node dist/index.js"]