Muhammad Sulaiman Yusuf
2 years ago
1 changed files with 14 additions and 15 deletions
@ -1,20 +1,19 @@
|
||||
FROM node:12 |
||||
WORKDIR /react-docker |
||||
COPY ./package*.json ./ |
||||
ENV PATH /app/node_modules/.bin:$PATH |
||||
CMD PORT=8445 npm start #--host 0.0.0.0 --port 3000 --disableHostCheck true |
||||
|
||||
FROM node:14.20-alpine3.15 |
||||
|
||||
WORKDIR /app |
||||
|
||||
COPY package*.json ./ |
||||
|
||||
RUN npm install |
||||
RUN npm i react@16.14.0 |
||||
RUN npm i react-scripts |
||||
RUN npm audit fix |
||||
|
||||
EXPOSE 8445 |
||||
COPY . . |
||||
|
||||
# Comment as needed (Production / Dev) |
||||
# [PROD] Use for Production |
||||
# COPY . . # uncomment prod |
||||
RUN npm run build --production |
||||
|
||||
# [DEV] Live Reload |
||||
RUN mkdir -p /react-docker/src # comment for prod |
||||
RUN mkdir -p /react-docker/public # comment for prod |
||||
RUN npm install -g serve |
||||
|
||||
CMD PORT=8445 npm start #--host 0.0.0.0 --port 3000 --disableHostCheck true |
||||
EXPOSE 8445 |
||||
|
||||
CMD serve -p 8455 -s build |
||||
|
Loading…
Reference in new issue