-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from kubeshop/mm/feat/webappdocker
feat: add docker files
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
build | ||
.dockerignore | ||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|
||
} |