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
selector:
matchLabels:
app: izaac
app: izaac-backend
template:
metadata:
labels:
app: izaac
app: izaac-backend
spec:
containers:
- name: izaac
- name: izaac-backend
image: registry.izaac.pl:5000/izaac:latest
ports:
- 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
kind: Service
metadata:
name: izaac
name: izaac-backend
spec:
selector:
app: izaac
app: izaac-backend
ports:
- protocol: TCP
port: 80
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
port: 8000
targetPort: 8000

View File

@ -12,6 +12,8 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
from pathlib import Path
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
@ -167,6 +169,7 @@ AUTH_USER_MODEL = "core.MyUser"
# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGE_CODE = "en-us"
TIME_ZONE = "UTC"
@ -181,6 +184,15 @@ USE_TZ = True
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
# 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
urlpatterns = [
# ...
path('api/', include(router.urls)),
path('', include(router.urls)),
]