From 0adfba12759f8abc5d437ecadff809019daef681 Mon Sep 17 00:00:00 2001 From: Ajurna Date: Wed, 2 Apr 2025 13:29:32 +0100 Subject: [PATCH] fixes --- .dockerignore | 3 ++- Dockerfile | 14 ++++++---- build.ps1 | 3 +-- entrypoint.sh | 7 ++--- frontend/src/views/UserView.vue | 1 - frontend/webpack.prod.js | 1 - pyproject.toml | 2 +- requirements.txt | 46 --------------------------------- 8 files changed, 17 insertions(+), 60 deletions(-) delete mode 100644 requirements.txt diff --git a/.dockerignore b/.dockerignore index 9131383..f6df608 100644 --- a/.dockerignore +++ b/.dockerignore @@ -14,5 +14,6 @@ !package-lock.json !package.json !frontend +!uv.lock /frontend/node_modules -/frontend/dist \ No newline at end of file +/frontend/dist diff --git a/Dockerfile b/Dockerfile index 92cda5f..d06d7cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM python:3.10-slim-bullseye +FROM python:3.13-slim-bullseye +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ ENV PYTHONFAULTHANDLER=1 \ PYTHONHASHSEED=random \ @@ -13,17 +14,20 @@ RUN mkdir /static WORKDIR /src -COPY . /src/ -RUN echo "deb http://ftp.uk.debian.org/debian bookworm non-free non-free-firmware" > /etc/apt/sources.list.d/non-free.list +COPY . /src/ +COPY pyproject.toml /src +COPY uv.lock /src + +RUN echo "deb http://ftp.uk.debian.org/debian bullseye non-free non-free-firmware" > /etc/apt/sources.list.d/non-free.list RUN apt update \ && apt install -y software-properties-common \ && apt-add-repository non-free \ && apt update \ - && apt install -y npm cron unrar libmariadb-dev libpq-dev \ - && uv sync \ + && apt install -y npm cron unrar libmariadb-dev libpq-dev pkg-config \ + && uv sync --frozen \ && cd frontend \ && npm install \ && npm run build \ diff --git a/build.ps1 b/build.ps1 index b6a4fa9..425a0c7 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,4 +1,3 @@ -poetry export --without-hashes -f requirements.txt --output requirements.txt -$version=poetry version -s +$version=uvx --from=toml-cli toml get --toml-path=pyproject.toml project.version docker build . -t ajurna/cbwebreader -t ajurna/cbwebreader:$version docker push ajurna/cbwebreader --all-tags diff --git a/entrypoint.sh b/entrypoint.sh index 3d7c730..b15a366 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,6 @@ -python manage.py migrate --settings=cbreader.settings.base +#!/usr/bin/env sh +uv run manage.py migrate --settings=cbreader.settings.base -python manage.py collectstatic --settings=cbreader.settings.base --noinput --clear +uv run manage.py collectstatic --settings=cbreader.settings.base --noinput --clear -gunicorn --workers 3 --bind 0.0.0.0:8000 cbreader.wsgi:application \ No newline at end of file +uv run gunicorn --workers 3 --bind 0.0.0.0:8000 cbreader.wsgi:application diff --git a/frontend/src/views/UserView.vue b/frontend/src/views/UserView.vue index 13c384e..8af926a 100644 --- a/frontend/src/views/UserView.vue +++ b/frontend/src/views/UserView.vue @@ -16,7 +16,6 @@ import UserEdit from "@/components/UserEdit"; import alertMessages from "@/components/AlertMessages"; import AddUser from "@/components/AddUser"; import router from "@/router"; -import store from "@/store"; const default_crumbs = [ {id: 0, selector: '', name: 'Home'}, diff --git a/frontend/webpack.prod.js b/frontend/webpack.prod.js index f17f59c..bf13440 100644 --- a/frontend/webpack.prod.js +++ b/frontend/webpack.prod.js @@ -2,7 +2,6 @@ const path = require('path') const { VueLoaderPlugin } = require('vue-loader') const BundleTracker = require('webpack-bundle-tracker'); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); -const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; const webpack = require('webpack') diff --git a/pyproject.toml b/pyproject.toml index dedffdf..f8893e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "cbwebreader" -version = "1.1.1" +version = "1.1.2" description = "CBR/Z Web Reader" readme = "README.md" requires-python = ">=3.13" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index c23cb25..0000000 --- a/requirements.txt +++ /dev/null @@ -1,46 +0,0 @@ -asgiref==3.7.2 ; python_version >= "3.12" and python_version < "4.0" -autopep8==2.0.4 ; python_version >= "3.12" and python_version < "4.0" -beautifulsoup4==4.12.2 ; python_version >= "3.12" and python_version < "4.0" -colorama==0.4.6 ; python_version >= "3.12" and python_version < "4.0" and sys_platform == "win32" -dj-database-url==2.1.0 ; python_version >= "3.12" and python_version < "4.0" -django-appconf==1.0.5 ; python_version >= "3.12" and python_version < "4.0" -django-boost==2.1 ; python_version >= "3.12" and python_version < "4.0" -django-bootstrap4==23.2 ; python_version >= "3.12" and python_version < "4.0" -django-cors-headers==4.2.0 ; python_version >= "3.12" and python_version < "4.0" -django-csp==3.7 ; python_version >= "3.12" and python_version < "4.0" -django-extensions==3.2.3 ; python_version >= "3.12" and python_version < "4.0" -django-filter==23.3 ; python_version >= "3.12" and python_version < "4.0" -django-imagekit==5.0.0 ; python_version >= "3.12" and python_version < "4.0" -django-permissions-policy==4.17.0 ; python_version >= "3.12" and python_version < "4.0" -django-silk==5.0.4 ; python_version >= "3.12" and python_version < "4.0" -django-sri==0.7.0 ; python_version >= "3.12" and python_version < "4.0" -django-webpack-loader==2.0.1 ; python_version >= "3.12" and python_version < "4.0" -django==4.2.5 ; python_version >= "3.12" and python_version < "4.0" -djangorestframework-simplejwt==5.3.0 ; python_version >= "3.12" and python_version < "4.0" -djangorestframework==3.14.0 ; python_version >= "3.12" and python_version < "4.0" -drf-extensions==0.7.1 ; python_version >= "3.12" and python_version < "4.0" -drf-yasg==1.21.7 ; python_version >= "3.12" and python_version < "4.0" -gprof2dot==2022.7.29 ; python_version >= "3.12" and python_version < "4.0" -gunicorn==21.2.0 ; python_version >= "3.12" and python_version < "4.0" -inflection==0.5.1 ; python_version >= "3.12" and python_version < "4.0" -loguru==0.7.2 ; python_version >= "3.12" and python_version < "4.0" -mysqlclient==2.2.0 ; python_version >= "3.12" and python_version < "4.0" -packaging==23.2 ; python_version >= "3.12" and python_version < "4.0" -pilkit==3.0 ; python_version >= "3.12" and python_version < "4.0" -pillow==10.0.1 ; python_version >= "3.12" and python_version < "4.0" -psycopg2-binary==2.9.9 ; python_version >= "3.12" and python_version < "4.0" -pycodestyle==2.11.0 ; python_version >= "3.12" and python_version < "4.0" -pyjwt==2.8.0 ; python_version >= "3.12" and python_version < "4.0" -pymupdf==1.20.2 ; python_version >= "3.12" and python_version < "4.0" -python-dotenv==1.0.0 ; python_version >= "3.12" and python_version < "4.0" -pytz==2023.3.post1 ; python_version >= "3.12" and python_version < "4.0" -pyyaml==6.0.1 ; python_version >= "3.12" and python_version < "4.0" -rarfile==4.1 ; python_version >= "3.12" and python_version < "4.0" -soupsieve==2.5 ; python_version >= "3.12" and python_version < "4.0" -sqlparse==0.4.4 ; python_version >= "3.12" and python_version < "4.0" -typing-extensions==4.8.0 ; python_version >= "3.12" and python_version < "4.0" -tzdata==2023.3 ; python_version >= "3.12" and python_version < "4.0" and sys_platform == "win32" -ua-parser==0.18.0 ; python_version >= "3.12" and python_version < "4.0" -uritemplate==4.1.1 ; python_version >= "3.12" and python_version < "4.0" -user-agents==2.2.0 ; python_version >= "3.12" and python_version < "4.0" -win32-setctime==1.1.0 ; python_version >= "3.12" and python_version < "4.0" and sys_platform == "win32"