chessGame / Dockerfile
ilhamdev's picture
Update Dockerfile
f3da77d verified
raw
history blame
710 Bytes
# Use an official Node runtime as a parent image
FROM node:18
# Create a directory for the application
WORKDIR /app
# Install nodemon globally
RUN npm install -g nodemon
# Copy the package.json and package-lock.json for both frontend and backend
COPY frontend/package*.json ./frontend/
COPY backend/package*.json ./backend/
# Install dependencies for frontend
WORKDIR /app/frontend
RUN npm install
# Install dependencies for backend
WORKDIR /app/backend
RUN npm install
# Copy the rest of the application code
WORKDIR /app
COPY . .
# Expose the ports
EXPOSE 5173
EXPOSE 3000
# Define the command to run the apps
CMD ["sh", "-c", "npm run dev --prefix /app/frontend & npm run dev --prefix /app/backend"]