comp review todo app update (#146)

* new todo frontend

* yarn --> npm

* basic Dockerfile

* add Helm chart for todo list

* backend working

* connect new-app'd frontend to backend via proxy_pass

* move nginx conf

* move nginx conf back

* move helm chart to course repo

* add simple SSR node.js service

* log error message

* fix host typo

* fix dockerfiles

* add link to items page

* improve probe route for todo-backend

* canary probe route for todo-backend

* Dockerfile -> Containerfile todo-backend

* Dockerfile -> Containerfile todo-frontend

* remove commands for containerfile as part of comp review
This commit is contained in:
Guy Bianco IV
2021-07-01 15:39:50 -04:00
committed by GitHub
parent 0ce74443fc
commit 577bdfb1d6
14 changed files with 1785 additions and 43 deletions

View File

@@ -3,15 +3,16 @@ FROM registry.access.redhat.com/ubi8/nodejs-14 AS appbuild
LABEL version="1.0"
LABEL description="To Do List application builder"
ENV REACT_APP_API_HOST=http://localhost:3000
# ENV REACT_APP_API_HOST=http://localhost:3000
ENV REACT_APP_API_HOST=""
USER 0
COPY . /tmp/todo-frontend
RUN cd /tmp/todo-frontend && \
npm install && \
npm run build
RUN cd /tmp/todo-frontend
RUN npm install
RUN npm run build
# https://github.com/sclorg/nginx-container
FROM registry.access.redhat.com/ubi8/nginx-118
@@ -24,8 +25,4 @@ LABEL updatedDate="2021-05-19"
COPY nginx.conf /etc/nginx/
COPY --from=appbuild /tmp/todo-frontend/build /usr/share/nginx/html
EXPOSE 8080
USER nginx
CMD nginx -g "daemon off;"

View File

@@ -2,8 +2,6 @@
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
env BACKEND_HOST;
worker_processes auto;
error_log stderr;
pid /run/nginx.pid;
@@ -34,8 +32,6 @@ http {
# for more information.
include /etc/nginx/conf.d/*.conf;
perl_set $backend 'sub { return $ENV{"BACKEND_HOST"}; }';
server {
listen 8080 default_server;
listen [::]:8080 default_server;
@@ -45,21 +41,13 @@ http {
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
sub_filter_types application/javascript;
sub_filter '_BACKEND_' $backend;
sub_filter_once off;
location /api/ {
proxy_pass http://todo-list:3000;
}
location / {
}
# error_page 404 /404.html;
# location = /40x.html {
# }
# error_page 500 502 503 504 /50x.html;
# location = /50x.html {
# }
}
}