Create Dockerfile for front production
This commit is contained in:
11
infra/prod/front/Dockerfile
Normal file
11
infra/prod/front/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
||||
FROM node:18-alpine as front
|
||||
|
||||
WORKDIR /app/front
|
||||
COPY ./front .
|
||||
|
||||
RUN npm install --production
|
||||
RUN npm run build
|
||||
|
||||
RUN npm install -g serve
|
||||
|
||||
CMD ["serve", "-s", "build"]
|
||||
@ -1,16 +0,0 @@
|
||||
FROM node:18-alpine as app
|
||||
|
||||
ARG REACT_APP_API_URL
|
||||
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
|
||||
WORKDIR /app/front
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
WORKDIR /app/server
|
||||
RUN npm install
|
||||
RUN npm run build
|
||||
|
||||
CMD ["npm", "run", "start:prod"]
|
||||
Reference in New Issue
Block a user