add build file

This commit is contained in:
bi 2022-01-11 11:20:27 +07:00
parent f12c0f7239
commit d5eacedc0f
4 changed files with 28 additions and 1 deletions

View File

@ -2,6 +2,7 @@ FROM node:12
WORKDIR /app WORKDIR /app
COPY ./app/package.json /app COPY ./app/package.json /app
# COPY ./app /app
RUN npm install RUN npm install
CMD npm start CMD npm start

9
docker-compose.prod.yml Normal file
View File

@ -0,0 +1,9 @@
version: "2"
services:
app:
build:
context: .
args:
- REACT_APP_HOST=http://api.face-classify.beetai.com
dockerfile: prod.dockerfile
image: registry.beetai.com:5000/fsi_web:1.0

View File

@ -9,7 +9,7 @@ services:
tty: true tty: true
image: registry.beetai.com:5000/fsi_view:dev_1.0 image: registry.beetai.com:5000/fsi_view:dev
ports: ports:
- "5201:3000" - "5201:3000"
volumes: volumes:

17
prod.dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM node:12
WORKDIR /app
COPY ./app/package.json /app
RUN npm install
RUN npm install -g serve
RUN npm audit fix
ARG REACT_APP_HOST
ENV REACT_APP_HOST $REACT_APP_HOST
COPY ./app /app
RUN npm run build
CMD serve -l 3000 -s build
EXPOSE 3000