-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 766 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (21 loc) · 766 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
FROM node:18
# Set the working directory in the container
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY ./frontend/package.json /app/frontend/package.json
COPY ./backend/package.json /app/backend/package.json
# Install the dependencies
RUN cd frontend && npm install
RUN cd backend && npm install
# Copy the rest of the application code to the working directory
COPY . .
# Build frontend to be served by backend
RUN cd frontend && npm run build
RUN cd backend && npm run build
RUN cd backend && npx prisma generate
# Expose the port that your app will run on
EXPOSE 8080
# Change to backend directory
WORKDIR /app/backend
# Define the command to run your app
CMD ["sh", "-c", "npx prisma migrate deploy && npm start"]