Skip to content

Commit

Permalink
Merge pull request #3 from datascience/feature/UI-conflicts
Browse files Browse the repository at this point in the history
Prepare the prod build
  • Loading branch information
artourkin authored Oct 25, 2023
2 parents 1b6a4a1 + a09116a commit d431625
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docker-compose.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
web:
build:
context: .
dockerfile: ./web/Dockerfile
dockerfile: ./web/Dockerfile.dev
container_name: web
env_file: .env
networks:
Expand Down
18 changes: 14 additions & 4 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
FROM node:14.5.0-stretch-slim
FROM node:14.5.0-stretch-slim as build



WORKDIR /app
COPY ./web/frontend ./

RUN npm install
ENV PATH /app/node_modules/.bin:$PATH
COPY ./web/frontend/package.json ./
COPY ./web/frontend/package-lock.json ./

RUN npm ci
RUN npm install [email protected] -g

COPY ./web/frontend ./
RUN npm run build


FROM nginx:stable-alpine-slim
COPY --from=build /app/build /usr/share/nginx/html
COPY ./web/nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 3000
CMD ["npm", "start"]
CMD ["nginx", "-g", "daemon off;"]

13 changes: 13 additions & 0 deletions web/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:14.5.0-stretch-slim



WORKDIR /app
COPY ./web/frontend ./

RUN npm install
RUN npm run build

EXPOSE 3000
CMD ["npm", "start"]

17 changes: 17 additions & 0 deletions web/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {

listen 3000;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}

error_page 500 502 503 504 /50x.html;

location = /50x.html {
root /usr/share/nginx/html;
}

}

0 comments on commit d431625

Please sign in to comment.