diff --git a/deployment.yml b/deployment.yml index 4b9ab59..a804678 100644 --- a/deployment.yml +++ b/deployment.yml @@ -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 \ No newline at end of file diff --git a/izaac/settings.py b/izaac/settings.py index b496337..9ddffc8 100644 --- a/izaac/settings.py +++ b/izaac/settings.py @@ -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 diff --git a/jobposting/urls.py b/jobposting/urls.py index 566be41..5536905 100644 --- a/jobposting/urls.py +++ b/jobposting/urls.py @@ -12,5 +12,5 @@ router.register(r'jobskills', views.JobSkillViewSet) # Twoje urlpatterns urlpatterns = [ # ... - path('api/', include(router.urls)), + path('', include(router.urls)), ] \ No newline at end of file