From 79f694522ef4028af711938ceadf0d2538644bc6 Mon Sep 17 00:00:00 2001 From: danbugs Date: Mon, 19 Feb 2024 12:30:58 -0800 Subject: [PATCH] Last fixes for frontend and backend Signed-off-by: danbugs --- Dockerfile-SmitheFrontend | 6 +++ Makefile | 4 ++ backend-service.yml | 3 +- frontend-ingress.yml | 16 +++++++ frontend-service.yml | 3 +- frontend/index.html | 4 +- frontend/nginx.conf | 45 +++++++++++++++++++ .../player_profile_tournament_list.rs | 7 +-- frontend/styles.css | 37 ++++++++------- image-upload-backend/app.js | 4 +- 10 files changed, 101 insertions(+), 28 deletions(-) create mode 100644 frontend-ingress.yml create mode 100644 frontend/nginx.conf diff --git a/Dockerfile-SmitheFrontend b/Dockerfile-SmitheFrontend index ae5aa12..0361f48 100644 --- a/Dockerfile-SmitheFrontend +++ b/Dockerfile-SmitheFrontend @@ -1,5 +1,11 @@ # Use Nginx as the base image FROM nginx:alpine +# Remove the default Nginx configuration file +RUN rm /etc/nginx/conf.d/default.conf + +# Copy the Nginx configuration file from your local frontend/nginx.conf to the container's Nginx conf directory +COPY frontend/nginx.conf /etc/nginx/conf.d/ + # Copy the dist folder from your local frontend/dist to the container's Nginx html directory COPY frontend/dist/ /usr/share/nginx/html/ diff --git a/Makefile b/Makefile index 5d1685f..de21165 100644 --- a/Makefile +++ b/Makefile @@ -89,6 +89,10 @@ build-frontend: serve-frontend: trunk serve ./frontend/index.html +.PHONY: run-image-backend +run-image-backend: + node ./image-upload-backend/app.js + # PYTHON .PHONY: py-install-reqs py-install-reqs: diff --git a/backend-service.yml b/backend-service.yml index 7cbb560..4a504dd 100644 --- a/backend-service.yml +++ b/backend-service.yml @@ -3,11 +3,10 @@ kind: Service metadata: name: backend-service spec: - type: NodePort + type: LoadBalancer selector: app: backend ports: - protocol: TCP port: 8000 targetPort: 8000 - nodePort: 31112 diff --git a/frontend-ingress.yml b/frontend-ingress.yml new file mode 100644 index 0000000..15625e0 --- /dev/null +++ b/frontend-ingress.yml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: frontend-ingress +spec: + rules: + - host: smithe.net + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: frontend-service + port: + number: 80 \ No newline at end of file diff --git a/frontend-service.yml b/frontend-service.yml index d9fbf77..89f0886 100644 --- a/frontend-service.yml +++ b/frontend-service.yml @@ -3,11 +3,10 @@ kind: Service metadata: name: frontend-service spec: - type: NodePort + type: LoadBalancer selector: app: frontend ports: - protocol: TCP port: 80 targetPort: 80 - nodePort: 31111 diff --git a/frontend/index.html b/frontend/index.html index 7203f84..54e0727 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -21,7 +21,9 @@ crossorigin="anonymous" referrerpolicy="no-referrer" /> - +