Add Dockerfile for backend and frontend
This commit is contained in:
13
Dockerfile.backend
Normal file
13
Dockerfile.backend
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /app/backend
|
||||
|
||||
COPY backend/package*.json ./
|
||||
|
||||
RUN npm install --production
|
||||
|
||||
COPY backend/ .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "start"]
|
||||
15
Dockerfile.frontend
Normal file
15
Dockerfile.frontend
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /app/frontend
|
||||
|
||||
COPY frontend/package*.json ./
|
||||
|
||||
RUN npm install
|
||||
|
||||
COPY frontend/ .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
EXPOSE 4173
|
||||
|
||||
CMD ["npm", "run", "preview"]
|
||||
Reference in New Issue
Block a user