IZAAC_BASE - reverse proxy
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Jakub K 2023-11-12 19:56:00 +01:00
parent 029ce6e214
commit 415efa917f
3 changed files with 27 additions and 25 deletions

View File

@ -6,44 +6,34 @@ spec:
replicas: 1 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: izaac app: izaac-backend
template: template:
metadata: metadata:
labels: labels:
app: izaac app: izaac-backend
spec: spec:
containers: containers:
- name: izaac - name: izaac-backend
image: registry.izaac.pl:5000/izaac:latest image: registry.izaac.pl:5000/izaac:latest
ports: ports:
- containerPort: 8000 - containerPort: 8000
volumeMounts:
- name: static-storage
mountPath: /usr/scr/app/staticfiles # Ścieżka, gdzie Django oczekuje plików statycznych
volumes:
- name: static-storage
persistentVolumeClaim:
claimName: static-pvc
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: izaac name: izaac-backend
spec: spec:
selector: selector:
app: izaac app: izaac-backend
ports: ports:
- protocol: TCP - protocol: TCP
port: 80 port: 8000
targetPort: 8000 targetPort: 8000
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: izaac-ingress
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: izaac-svc
port:
number: 80

View File

@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
from pathlib import Path from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'. # Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent BASE_DIR = Path(__file__).resolve().parent.parent
@ -167,6 +169,7 @@ AUTH_USER_MODEL = "core.MyUser"
# Internationalization # Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/ # https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGE_CODE = "en-us" LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC" TIME_ZONE = "UTC"
@ -181,6 +184,15 @@ USE_TZ = True
STATIC_URL = "static/" STATIC_URL = "static/"
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'staticfiles')
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
# Default primary key field type # Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field

View File

@ -12,5 +12,5 @@ router.register(r'jobskills', views.JobSkillViewSet)
# Twoje urlpatterns # Twoje urlpatterns
urlpatterns = [ urlpatterns = [
# ... # ...
path('api/', include(router.urls)), path('', include(router.urls)),
] ]