bump for spectacular

This commit is contained in:
2025-05-11 10:19:24 +02:00
parent 043a0e03d1
commit 8eaf07aedc
5 changed files with 12 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
FROM python:3.11-slim FROM python:3.13-slim
ENV PYTHONUNBUFFERED=1 ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONDONTWRITEBYTECODE=1
@@ -13,7 +13,7 @@ COPY --chown=appuser:appuser marbas /app/marbas
COPY --chown=appuser:appuser sde /app/sde COPY --chown=appuser:appuser sde /app/sde
COPY --chown=appuser:appuser api /app/api COPY --chown=appuser:appuser api /app/api
COPY --chown=appuser:appuser authentication /app/authentication COPY --chown=appuser:appuser authentication /app/authentication
COPY --chown=appuser:appuser static /app/static #COPY --chown=appuser:appuser static /app/static
USER appuser USER appuser
CMD ["uvicorn", "marbas.asgi:application", "--host", "0.0.0.0", "--port", "8000"] CMD ["uvicorn", "marbas.asgi:application", "--host", "0.0.0.0", "--port", "8000"]

View File

@@ -21,6 +21,9 @@ services:
eveal: eveal:
image: marbas:local image: marbas:local
build:
context: .
dockerfile: Dockerfile
env_file: env_file:
- .env - .env
ports: ports:

View File

@@ -51,6 +51,7 @@ REST_FRAMEWORK = {
'mozilla_django_oidc.contrib.drf.OIDCAuthentication', 'mozilla_django_oidc.contrib.drf.OIDCAuthentication',
'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.SessionAuthentication',
], ],
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
} }
INSTALLED_APPS = [ INSTALLED_APPS = [
@@ -68,6 +69,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles', 'django.contrib.staticfiles',
'django_filters', 'django_filters',
'health_check', 'health_check',
'drf_spectacular',
'rest_framework', 'rest_framework',
] ]

View File

@@ -18,6 +18,7 @@ from django.urls import include, path
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.contrib import admin from django.contrib import admin
from drf_spectacular.views import SpectacularAPIView, SpectacularSwaggerView, SpectacularRedocView
from rest_framework.schemas import get_schema_view from rest_framework.schemas import get_schema_view
from django.views.generic import TemplateView from django.views.generic import TemplateView
@@ -28,18 +29,8 @@ urlpatterns = [
path('auth/', include("authentication.urls")), path('auth/', include("authentication.urls")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
path('sso/', include('esi.urls', namespace='esi')), path('sso/', include('esi.urls', namespace='esi')),
path('openapi/', get_schema_view( path('openapi/', SpectacularAPIView.as_view(), name='openapi-schema'),
title="marbas", path('swagger-ui/', SpectacularSwaggerView.as_view(url_name='openapi-schema'), name='swagger-ui'),
description="API for EvEal", path('redoc/', SpectacularRedocView.as_view(url_name='openapi-schema'), name='redoc'),
version="0.0.9"
), name='openapi-schema'),
path('swagger-ui/', TemplateView.as_view(
template_name='swagger-ui.html',
extra_context={'schema_url': 'openapi-schema'}
), name='swagger-ui'),
path('redoc/', TemplateView.as_view(
template_name='redoc.html',
extra_context={'schema_url': 'openapi-schema'}
), name='redoc'),
path('ht/', include('health_check.urls')), path('ht/', include('health_check.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

View File

@@ -1,6 +1,7 @@
django django
djangorestframework djangorestframework
django-filter django-filter
drf-spectacular
markdown markdown
uvicorn[standard] uvicorn[standard]
psycopg[binary] psycopg[binary]