This commit is contained in:
49
Dockerfile
Normal file
49
Dockerfile
Normal file
@ -0,0 +1,49 @@
|
||||
# Use official Node.js image
|
||||
FROM node:24
|
||||
|
||||
### Client Stage
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# create client directory
|
||||
RUN mkdir client
|
||||
# Set the working directory for the client
|
||||
WORKDIR /app/client
|
||||
|
||||
# Copy package files and install dependencies
|
||||
COPY /client/package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy server source code
|
||||
COPY /client .
|
||||
|
||||
# Build the server (if using TypeScript or build step)
|
||||
RUN npm run build
|
||||
|
||||
### Server Stage
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# create server directory
|
||||
RUN mkdir server
|
||||
|
||||
# Set the working directory for the server
|
||||
WORKDIR /app/server
|
||||
|
||||
# Copy package files and install dependencies
|
||||
COPY /server/package*.json ./
|
||||
RUN npm install
|
||||
|
||||
# Copy server source code
|
||||
COPY /server .
|
||||
|
||||
# no build step for server, its already JavaScript
|
||||
|
||||
# Production stage
|
||||
# Expose the port your server runs on (change if needed)
|
||||
EXPOSE 8000
|
||||
|
||||
# Start the server
|
||||
CMD ["npm", "start"]
|
||||
Reference in New Issue
Block a user