diff --git a/frontend/Dockerfile b/frontend/Dockerfile index dffea1a128..2f9361c633 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,32 +1,15 @@ -# stage1 as builder -FROM node:14-alpine as builder - -# copy the package.json to install dependencies -COPY package.json ./ - -# Install the dependencies and make the folder -RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui - -WORKDIR /react-ui - -COPY . . - -# Build the project and copy the files -RUN npm run build +FROM node:12.20.1-alpine3.9 -FROM nginx:1.15-alpine +ADD ./ ./frontend -#!/bin/sh +WORKDIR /frontend -COPY conf/default.conf /etc/nginx/conf.d/default.conf +RUN yarn && yarn build +RUN yarn global add serve -## Remove default nginx index page -RUN rm -rf /usr/share/nginx/html/* +ARG PORT=3000 -# Copy from the stahg 1 -COPY --from=builder /react-ui/build /usr/share/nginx/html +EXPOSE $PORT -EXPOSE 3000 - -ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["serve", "-s","build"] \ No newline at end of file diff --git a/frontend/docker-compose.yml b/frontend/docker-compose.yml new file mode 100644 index 0000000000..b102e15577 --- /dev/null +++ b/frontend/docker-compose.yml @@ -0,0 +1,6 @@ +version: "3.9" +services: + web: + build: . + ports: + - "3000:3000" \ No newline at end of file