diff --git a/dev/efc-shop/deployment.yaml b/dev/efc-shop/deployment.yaml index 153483f..e320436 100644 --- a/dev/efc-shop/deployment.yaml +++ b/dev/efc-shop/deployment.yaml @@ -99,6 +99,19 @@ data: send_timeout 300s; } + location /storage { + proxy_pass http://backend/storage; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 300s; + proxy_send_timeout 300s; + send_timeout 300s; + } + error_page 404 =200 /index.html; add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; diff --git a/dev/efc/deployment.yaml b/dev/efc/deployment.yaml index 9e3cc41..39a78aa 100644 --- a/dev/efc/deployment.yaml +++ b/dev/efc/deployment.yaml @@ -18,10 +18,6 @@ spec: labels: app: efc-dev spec: - # securityContext: - # runAsUser: 1000 - # runAsGroup: 1000 - # fsGroup: 1000 containers: - name: efc-frontend image: packages.semapp.lan:5000/efc-admin_frontend:develop @@ -58,13 +54,39 @@ spec: name: efc-backend protocol: TCP imagePullPolicy: Always + volumeMounts: + - mountPath: /opt/efc/storage + name: efc-pv-dev + - mountPath: /opt/efc/static + name: efc-dev-static envFrom: - - configMapRef: - name: efc-dev-config-dev + - configMapRef: + name: efc-dev-config-dev volumes: - - name: nginx-conf - configMap: - name: nginx-conf + - name: nginx-conf + configMap: + name: nginx-conf + - name: efc-pv-dev + persistentVolumeClaim: + claimName: efc-pvc-dev + - name: efc-dev-static + emptyDir: {} +--- +# Persistent Volume Claim description +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: efc-pvc-dev + namespace: dev-environment + labels: + app: efc-dev +spec: + storageClassName: longhorn + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi --- apiVersion: v1 @@ -83,7 +105,6 @@ data: DJANGO_DB_PORT: "5432" ALLOWED_HOSTS: '["*"]' FRONTEND_URL: "http://efc-dev.k3s.semapp.lan" - # API_URL: "http://efc-dev.k3s.semapp.lan/" REACT_APP_PROD_API_URL: "http://efc-dev.k3s.semapp.lan/" REACT_APP_DEV_API_URL: http://efc-dev.k3s.semapp.lan/ PORT_FRONTEND: '8500' @@ -127,6 +148,47 @@ data: send_timeout 300s; } + location /storage { + proxy_pass http://backend/storage; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 300s; + proxy_send_timeout 300s; + send_timeout 300s; + } + + location /admin { + proxy_pass http://backend/admin; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 300s; + proxy_send_timeout 300s; + send_timeout 300s; + } + + location /static { + proxy_pass http://backend/static; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 300s; + proxy_send_timeout 300s; + send_timeout 300s; + } + + + error_page 404 =200 /index.html; add_header 'Cache-Control' 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';