2024-10-29 16:47:10 -04:00
|
|
|
# Use the Node base image
|
2024-11-10 20:42:02 -05:00
|
|
|
FROM node:18 AS quizroom
|
2024-10-29 16:47:10 -04:00
|
|
|
|
|
|
|
|
# Create a working directory
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
2024-11-05 16:37:07 -05:00
|
|
|
# Copy package.json and package-lock.json (if available) and install dependencies
|
2024-10-29 16:47:10 -04:00
|
|
|
COPY package*.json ./
|
|
|
|
|
RUN npm install
|
|
|
|
|
|
2024-11-05 16:37:07 -05:00
|
|
|
# Copy the rest of the source code to the container
|
2024-10-29 16:47:10 -04:00
|
|
|
COPY . .
|
|
|
|
|
|
2024-11-05 16:37:07 -05:00
|
|
|
# Build the TypeScript code
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
2024-10-29 16:47:10 -04:00
|
|
|
# Expose WebSocket server port
|
|
|
|
|
EXPOSE 4500
|
|
|
|
|
|
2024-11-05 16:37:07 -05:00
|
|
|
# Start the server using the compiled JavaScript file
|
|
|
|
|
CMD ["node", "dist/app.js"]
|