File size: 903 Bytes
43bfdfd a559367 f3da77d 39a61f8 553ce4e 43bfdfd a559367 43bfdfd a559367 43bfdfd a559367 43bfdfd 9449f29 553ce4e 39a61f8 43bfdfd a559367 970de04 39a61f8 |
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 |
# Use an official Node runtime as a parent image
FROM node:18
# Install nodemon globally
RUN npm install -g nodemon
# Create a directory for the application
WORKDIR /app
# Copy 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 . .
# Set correct permissions for all files
RUN chmod -R 755 /app/frontend /app/backend /app/backend/engine
# Expose the ports
EXPOSE 5173
EXPOSE 3000
# Define the command to run the apps using nodemon
CMD ["sh", "-c", "nodemon --watch /app/frontend --exec 'npm run dev --prefix /app/frontend' & nodemon --watch /app/backend --exec 'npm run dev --prefix /app/backend'"]
|