Skip to content

Commit

Permalink
Merge pull request #42 from kubeshop/mm/feat/webappdocker
Browse files Browse the repository at this point in the history
feat: add docker files
  • Loading branch information
mortada-codes authored Feb 24, 2022
2 parents e0490b5 + 6cfe9b4 commit 2752163
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/. dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
build
.dockerignore
Dockerfile
17 changes: 17 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# build environment
FROM node:16.14.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY package-lock.json ./
RUN npm ci --silent
COPY . ./
RUN npm run build

# production environment
FROM nginx:stable-alpine
COPY --from=build /app/build /usr/share/nginx/html
# new
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
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 80;

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 2752163

Please sign in to comment.