commit 369e02284d59d51190b08f9f28f09e9fde2bed31
Author: Schwobik <michal.schwob@seznam.cz>
Date:   Mon Apr 11 23:01:42 2022 +0200

    Working deployment
    re #9333

diff --git a/backend/app-deployment.yaml b/backend/app-deployment.yaml
index 031feca..24011a9 100644
--- a/backend/app-deployment.yaml
+++ b/backend/app-deployment.yaml
@@ -2,7 +2,7 @@ apiVersion: apps/v1
 kind: Deployment
 metadata:
   annotations:
-    kompose.cmd: kompose convert
+    kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
     kompose.version: 1.26.0 (40646f47)
   creationTimestamp: null
   labels:
@@ -17,7 +17,7 @@ spec:
   template:
     metadata:
       annotations:
-        kompose.cmd: kompose convert
+        kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
         kompose.version: 1.26.0 (40646f47)
       creationTimestamp: null
       labels:
@@ -27,7 +27,7 @@ spec:
         - env:
             - name: SPRING_DATASOURCE_URL
               value: jdbc:postgresql://db:5432/test
-          image: schwobik/backend-app:1.0
+          image: schwobik/backend-app:1.2
           name: app-backend
           ports:
             - containerPort: 8080
diff --git a/backend/app-service.yaml b/backend/app-service.yaml
index 83d948e..26a34bc 100644
--- a/backend/app-service.yaml
+++ b/backend/app-service.yaml
@@ -2,7 +2,7 @@ apiVersion: v1
 kind: Service
 metadata:
   annotations:
-    kompose.cmd: kompose convert
+    kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
     kompose.version: 1.26.0 (40646f47)
   creationTimestamp: null
   labels:
diff --git a/backend/db-data-persistentvolumeclaim.yaml b/backend/db-data-persistentvolumeclaim.yaml
index 7ce0c1e..803a5b9 100644
--- a/backend/db-data-persistentvolumeclaim.yaml
+++ b/backend/db-data-persistentvolumeclaim.yaml
@@ -11,4 +11,4 @@ spec:
   resources:
     requests:
       storage: 100Mi
-status: { }
+status: {}
diff --git a/backend/db-deployment.yaml b/backend/db-deployment.yaml
index 71fc1ad..7503bf2 100644
--- a/backend/db-deployment.yaml
+++ b/backend/db-deployment.yaml
@@ -2,7 +2,7 @@ apiVersion: apps/v1
 kind: Deployment
 metadata:
   annotations:
-    kompose.cmd: kompose convert
+    kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
     kompose.version: 1.26.0 (40646f47)
   creationTimestamp: null
   labels:
@@ -18,7 +18,7 @@ spec:
   template:
     metadata:
       annotations:
-        kompose.cmd: kompose convert
+        kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
         kompose.version: 1.26.0 (40646f47)
       creationTimestamp: null
       labels:
@@ -36,13 +36,6 @@ spec:
           name: postgres-db
           ports:
             - containerPort: 5432
-          resources: { }
-          volumeMounts:
-            - mountPath: /var/lib/postgresql/data
-              name: db-data
+          resources: {}
       restartPolicy: Always
-      volumes:
-        - name: db-data
-          persistentVolumeClaim:
-            claimName: db-data
 status: {}
diff --git a/backend/db-service.yaml b/backend/db-service.yaml
index 5b6a190..c96ee07 100644
--- a/backend/db-service.yaml
+++ b/backend/db-service.yaml
@@ -2,7 +2,7 @@ apiVersion: v1
 kind: Service
 metadata:
   annotations:
-    kompose.cmd: kompose convert
+    kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
     kompose.version: 1.26.0 (40646f47)
   creationTimestamp: null
   labels:
@@ -13,9 +13,6 @@ spec:
     - name: "5432"
       port: 5432
       targetPort: 5432
-    - name: 5432-tcp
-      port: 5432
-      targetPort: 5432
   selector:
     io.kompose.service: db
 status:
diff --git a/backend/docker-compose.yml b/backend/docker-compose.yml
index 1360644..f9b1166 100644
--- a/backend/docker-compose.yml
+++ b/backend/docker-compose.yml
@@ -19,7 +19,7 @@ services:
   app: # Spring boot application
     build: .
     container_name: app-backend  # name of the container
-    image: schwobik/backend-app:1.0
+    image: schwobik/backend-app:1.2
     ports:
       - "8080:8080"                 # expose port 8080 out of the docker container do the local machine
     depends_on:
@@ -31,7 +31,7 @@ services:
     # Since our Dockerfile for web-server is located in react-app foler, our build context is ./react-app
     build: ../frontend
     container_name: frontend
-    image: schwobik/frontend-app:1.0
+    image: schwobik/frontend-app:1.2
     ports:
       - "80:80"
 
diff --git a/backend/frontend-deployment.yaml b/backend/frontend-deployment.yaml
index 7d525ce..735ea32 100644
--- a/backend/frontend-deployment.yaml
+++ b/backend/frontend-deployment.yaml
@@ -2,7 +2,7 @@ apiVersion: apps/v1
 kind: Deployment
 metadata:
   annotations:
-    kompose.cmd: kompose convert
+    kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
     kompose.version: 1.26.0 (40646f47)
   creationTimestamp: null
   labels:
@@ -13,21 +13,21 @@ spec:
   selector:
     matchLabels:
       io.kompose.service: frontend
-  strategy: { }
+  strategy: {}
   template:
     metadata:
       annotations:
-        kompose.cmd: kompose convert
+        kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
         kompose.version: 1.26.0 (40646f47)
       creationTimestamp: null
       labels:
         io.kompose.service: frontend
     spec:
       containers:
-        - image: schwobik/frontend-app:1.0
+        - image: schwobik/frontend-app:1.2
           name: frontend
           ports:
             - containerPort: 80
-          resources: { }
+          resources: {}
       restartPolicy: Always
-status: { }
+status: {}
diff --git a/backend/frontend-service.yaml b/backend/frontend-service.yaml
index ba7637b..98b0f61 100644
--- a/backend/frontend-service.yaml
+++ b/backend/frontend-service.yaml
@@ -2,7 +2,7 @@ apiVersion: v1
 kind: Service
 metadata:
   annotations:
-    kompose.cmd: kompose convert
+    kompose.cmd: D:\Skola\5_leto\ASWI\Semestralka\aswi2022code-of-duty\kompose.exe convert
     kompose.version: 1.26.0 (40646f47)
   creationTimestamp: null
   labels:
@@ -15,5 +15,6 @@ spec:
       targetPort: 80
   selector:
     io.kompose.service: frontend
+  type: LoadBalancer
 status:
-  loadBalancer: { }
+  loadBalancer: {}
diff --git a/frontend/.env b/frontend/.env
index 2434052..ae3abf8 100644
--- a/frontend/.env
+++ b/frontend/.env
@@ -1 +1 @@
-REACT_APP_API_BASE_URL=http://localhost:8080
\ No newline at end of file
+REACT_APP_API_BASE_URL=/api
\ No newline at end of file
diff --git a/frontend/nginx/nginx.conf b/frontend/nginx/nginx.conf
index 5a415a8..4a52cb8 100644
--- a/frontend/nginx/nginx.conf
+++ b/frontend/nginx/nginx.conf
@@ -1,3 +1,6 @@
+upstream app {
+    server app:8080;
+}
 server {
     listen 80;
 
@@ -8,12 +11,8 @@ server {
         try_files $uri $uri/ /index.html;
     }
 
-    location /api/ {
-        proxy_pass http://app-backend:8080/api/;
-        proxy_http_version 1.1;
-        proxy_set_header Upgrade $http_upgrade;
-        proxy_set_header Connection 'upgrade';
-        proxy_set_header Host $host;
-        proxy_cache_bypass $http_upgrade;
+    location /api {
+        rewrite /api/(.*) /$1 break;
+        proxy_pass http://app;
     }
 }
\ No newline at end of file
diff --git a/frontend/requests/login.http b/frontend/requests/login.http
index 69bb9f9..9c402c2 100644
--- a/frontend/requests/login.http
+++ b/frontend/requests/login.http
@@ -1,5 +1,5 @@
 POST /login
-Host: localhost:8080
+Host: /api
 Content-Type: application/json
 
 {
diff --git a/frontend/requests/register.http b/frontend/requests/register.http
index ba4fa8f..0eeab65 100644
--- a/frontend/requests/register.http
+++ b/frontend/requests/register.http
@@ -1,5 +1,5 @@
 POST /register
-Host: localhost:8080
+Host: /api
 Content-Type: application/json
 
 
diff --git a/frontend/src/.env b/frontend/src/.env
index 7e81ec9..ae3abf8 100644
--- a/frontend/src/.env
+++ b/frontend/src/.env
@@ -1 +1 @@
-REACT_APP_API_BASE_URL=http://localhost:8080/api
\ No newline at end of file
+REACT_APP_API_BASE_URL=/api
\ No newline at end of file
diff --git a/frontend/src/config/conf.ts b/frontend/src/config/conf.ts
index 703555b..7c592a3 100644
--- a/frontend/src/config/conf.ts
+++ b/frontend/src/config/conf.ts
@@ -1,5 +1,5 @@
 const conf = {
-    baseUrl: 'http://localhost:8080'
+    baseUrl: '/api'
 }
 
 export default conf;
\ No newline at end of file
diff --git a/frontend/src/swagger/http-client.ts b/frontend/src/swagger/http-client.ts
index ab33905..e994ab9 100644
--- a/frontend/src/swagger/http-client.ts
+++ b/frontend/src/swagger/http-client.ts
@@ -54,7 +54,7 @@ export enum ContentType {
 }
 
 export class HttpClient<SecurityDataType = unknown> {
-  public baseUrl: string = "http://localhost:8080";
+  public baseUrl: string = "/api";
   private securityData: SecurityDataType | null = null;
   private securityWorker?: ApiConfig<SecurityDataType>["securityWorker"];
   private abortControllers = new Map<CancelToken, AbortController>();
