From 3e4d58f80d933259094c3adbeb5c8f7b340953d7 Mon Sep 17 00:00:00 2001 From: Brunobrno Date: Thu, 29 Jan 2026 01:31:33 +0100 Subject: [PATCH] Update URLs, Docker config, and Tailwind setup Added static and media file serving and Silk profiling in Django URLs. Updated docker-compose to mount backend/frontend code, adjust commands, and switch to 'trznice' app references. Enhanced Tailwind config to extend default colors and import defaultTheme. --- backend/vontor_cz/urls.py | 10 +++++++++- backups/backup-20260126-155148.sql | 0 backups/backup-20260127-192753.sql | 0 docker-compose.yml | 22 ++++++++++++++-------- frontend/tailwind.config.js | 5 +++++ 5 files changed, 28 insertions(+), 9 deletions(-) create mode 100644 backups/backup-20260126-155148.sql create mode 100644 backups/backup-20260127-192753.sql diff --git a/backend/vontor_cz/urls.py b/backend/vontor_cz/urls.py index 0ec0c74..3a054de 100644 --- a/backend/vontor_cz/urls.py +++ b/backend/vontor_cz/urls.py @@ -16,6 +16,10 @@ Including another URLconf """ from django.contrib import admin from django.urls import path, include +from django.conf.urls.static import static +from django.conf import settings + +from django import settings from .views import choices from drf_spectacular.views import ( @@ -45,4 +49,8 @@ urlpatterns = [ path("api/payments/gopay/", include("thirdparty.gopay.urls", namespace="gopay")), path('api/zasilkovna/', include('thirdparty.zasilkovna.urls')), path('api/deutschepost/', include('thirdparty.deutschepost.urls')), -] +] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + +if settings.DEBUG: + urlpatterns += [path('silk/', include('silk.urls', namespace='silk'))] + diff --git a/backups/backup-20260126-155148.sql b/backups/backup-20260126-155148.sql new file mode 100644 index 0000000..e69de29 diff --git a/backups/backup-20260127-192753.sql b/backups/backup-20260127-192753.sql new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index 72f8535..338b8ed 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -13,13 +13,14 @@ services: - db - redis volumes: + - ./backend:/app - static-data:/app/collectedstaticfiles - media-data:/app/media command: sh -c " - python manage.py migrate --verbosity 3 --noinput && - python manage.py check && - python manage.py collectstatic --clear --noinput --verbosity 3 && - gunicorn -k uvicorn.workers.UvicornWorker vontor_cz.asgi:application --bind 0.0.0.0:8000" + python manage.py migrate --noinput && + python manage.py collectstatic --clear --noinput && + python manage.py seed_app_config && + gunicorn -k uvicorn.workers.UvicornWorker trznice.asgi:application --bind 0.0.0.0:8000" ports: - "8000:8000" @@ -55,10 +56,12 @@ services: build: context: ./backend dockerfile: Dockerfile - command: sh -c "python manage.py migrate --noinput && celery -A vontor_cz worker --loglevel=info" + command: celery -A trznice worker --loglevel=info restart: always env_file: - ./backend/.env + volumes: + - ./backend:/app depends_on: - redis - db @@ -71,10 +74,12 @@ services: build: context: ./backend dockerfile: Dockerfile - command: sh -c "python manage.py migrate --noinput && celery -A vontor_cz beat --loglevel=info" + command: celery -A trznice beat --loglevel=info restart: always env_file: - ./backend/.env + volumes: + - ./backend:/app depends_on: - redis - db @@ -92,13 +97,14 @@ services: env_file: - ./frontend/.env ports: - # - 80:80 - - 9000:80 + - 80:80 + # - 9000:80 depends_on: - backend networks: - app_network volumes: + - ./frontend/dist:/usr/share/nginx/html - static-data:/app/collectedstaticfiles # static (Django) - media-data:/app/media # media (Django) - ./frontend/nginx/nginx.conf:/etc/nginx/nginx.conf:ro diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index f5faa5f..7b02bd1 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -1,3 +1,5 @@ +import defaultTheme from 'tailwindcss/defaultTheme' + /** @type {import('tailwindcss').Config} */ export default { content: [ @@ -18,6 +20,9 @@ export default { brandGlass: 'linear-gradient(180deg, color-mix(in hsl, var(--c-background-light), transparent 30%), color-mix(in hsl, black, transparent 70%))' }, colors: { + // Keep all default Tailwind colors (including yellow) + ...defaultTheme.colors, + // Add your custom brand colors brand: { bg: 'var(--c-background)', bgLight: 'var(--c-background-light)',