Commit Graph

55 Commits

Author SHA1 Message Date
FuzzyGrim
c32a39cc1c use same alpine version for builder as runtime image 2026-05-17 16:18:34 +02:00
David Davis
e6765fa636 Migrate to uv (#1434)
* init uv project

* fix workflow for uv

* updated docs

* update dependabot to use uv

* lock python version

* fix python version

* update uv deps

* Address PR review feedback

- Match dependency versions to dev branch (Django 5.2.13, allauth 65.15.1,
  health-check 4.2.2 with [celery,redis] extras, ruff 0.15.10, fakeredis[lua])
- Remove unused django-decorator-include
- Restore single-line ruff ignore array (unrelated whitespace)
- Drop description/readme; mark as non-package via [tool.uv]
- Install supervisor via apk in Dockerfile
- Fix CI: use 'uv run playwright install'; drop unused --all-extras
- README: set `dynamic = ["version"]` to avoid declaring version

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Fix container startup after switch to uv base image

- Dockerfile: prepend /.venv/bin to PATH so python/gunicorn/celery
  resolve directly (entrypoint.sh and supervisord.conf invoke them by
  name).
- entrypoint.sh: drop hardcoded /usr/local/bin/ prefix for supervisord;
  apk installs it to /usr/bin/supervisord, so let PATH resolve it.
- uv.lock: regenerated after pyproject.toml switched to dynamic version.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Add mkdocs and supervisor as uv deps; lint pyproject.toml

- Add a 'docs' dependency group with mkdocs and its plugins; switch
  build-docs.yml to use uv and remove docs/requirements.txt.
- Add supervisor to project deps so it ships in /.venv/bin instead of
  via apk in the Docker image.
- Add validate-pyproject and pyproject-fmt as dev deps and pre-commit
  hooks; reformat pyproject.toml accordingly.
- Drop unused dynamic version metadata (app version comes from the
  VERSION env var, not package metadata).

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Move uv virtualenv into /yamtrack workdir

Set WORKDIR before copying pyproject.toml and uv.lock so the
uv-managed virtualenv is created at /yamtrack/.venv. Update PATH
accordingly and ignore .venv in .dockerignore.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Pin Python version to 3.12

Add .python-version so uv (and pyenv) consistently select the
same interpreter when creating the virtualenv.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Enable uv bytecode compilation in Docker image

Set UV_COMPILE_BYTECODE=1 so uv precompiles .pyc files during
'uv sync'. This trades a small build-time cost for faster
container/worker startup since Python doesn't have to compile
modules on first import.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Use multi-stage Docker build to slim the runtime image

Build the virtualenv with uv in a builder stage based on
ghcr.io/astral-sh/uv:python3.12-alpine, then copy /yamtrack/.venv
into a clean python:3.12-alpine final stage. The final image no
longer carries the uv binary or its build cache, and collectstatic
runs via 'python manage.py' since the venv is on PATH.

Set UV_LINK_MODE=copy in the builder so packages are copied (not
symlinked from a cache that the final stage will not see).

Reduces image size by roughly 150 MB in local testing.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Drop validate-pyproject and pyproject-fmt; revert pyproject formatting

Remove the validate-pyproject and pyproject-fmt pre-commit hooks
and dev dependencies, and revert the cosmetic pyproject.toml
formatting that pyproject-fmt had applied (e.g. nested
[tool.ruff.lint.*] tables and tight list spacing) to match the
dev branch style.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Pin Alpine version and preserve bytecode in Docker build

- Pin both builder and final stages to alpine3.21 for reproducibility
  and binary compatibility between the virtualenv and runtime image.
- Stop deleting __pycache__ after uv sync so the bytecode compiled via
  UV_COMPILE_BYTECODE=1 is actually shipped, giving faster startup and
  avoiding runtime compilation on read-only filesystems.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Add django-tailwind-cli for Tailwind integration

Replaces the standalone tailwindcss CLI workflow with django-tailwind-cli,
which downloads and manages the standalone Tailwind binary itself. The
output path (static/css/main.css) is preserved so base.html and the
production build are unchanged.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Split dev dependency group into lint and test

The dev group now includes both via include-group, preserving the existing
'uv sync' behavior while allowing lint-only or test-only installs.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Revert "Add django-tailwind-cli for Tailwind integration"

This reverts commit 3796e53e347b81784e69fa0328c4e3d35be90d55.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

* Add back pinning version to `0.0.0`

Using `dynamic`, uv tries to build an egg every time dependencies are
added/removed.

* Switch docs group from mkdocs to zensical

Upstream migrated documentation tooling from mkdocs to zensical. Replace
the mkdocs-* plugins in the docs dependency group with zensical and the
squidfunk fork of mike that zensical expects.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>

---------

Co-authored-by: Eddi <75438446+minerop5000@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: David Davis <86290+daviddavis@users.noreply.github.com>
2026-05-17 14:58:53 +02:00
FuzzyGrim
04a97361be update supervisord version, #1191 2026-02-13 21:24:40 +01:00
Timothy Stott
9d9f03001e Add IPv6 support
This change remains backward compatible, as IPv6 support is disabled by default.

Nginx fails to start when an IPv6 `listen` directive is specified on an
IPv4-only host, preventing a single configuration from supporting both
protocols. To work around this limitation, the Docker image build
process now generates a separate copy of the Nginx configuration for IPv6.

An environment variable can be used to select either the IPv4 or IPv6
configuration when launching the container.

By embedding both configurations during the image build, we avoid making
file system changes at runtime — a step toward an immutable filesystem design.
2026-01-08 23:45:44 +00:00
Xila Cai
0e5604276b Issue 637 (#639)
* Remove database connection pool option from settings

* Revert "Remove database connection pool option from settings"

This reverts commit fdcbd792d5.

* add bulk operations and more logging

* Revert "add bulk operations and more logging"

This reverts commit c92e6eda12.

* add logs for debugging

* increase healthcheck time

* reorder migrations

* optimize episode repeats migration
2025-06-20 13:01:25 +02:00
FuzzyGrim
ecb9b5cd65 apply ruff and add default secret for easier github actions setup 2025-05-27 16:54:50 +02:00
p7996619
bc92937fbb Add support for reading from container secrets 2025-05-22 17:54:26 +02:00
FuzzyGrim
74483acc62 Add versioning support to Dockerfile and GitHub Actions workflow 2025-04-23 22:21:41 +02:00
FuzzyGrim
8124fffde2 fix: streamline nginx directory creation and ownership settings in Dockerfile and entrypoint script 2025-03-24 21:51:35 +01:00
FuzzyGrim
eb934b36a8 fix: user management in Docker container startup 2025-03-13 15:37:23 +01:00
FuzzyGrim
f988675544 update health check endpoint and add decorator for login-free access 2025-03-12 19:47:53 +01:00
FuzzyGrim
171084dac7 refactor Dockerfile; switch to Alpine base image 2025-03-12 19:44:30 +01:00
FuzzyGrim
52d628bf5c add better health check 2025-03-08 13:17:13 +01:00
FuzzyGrim
cb084521a8 fix: adjust healthcheck parameters for improved reliability 2025-02-21 10:28:43 +01:00
FuzzyGrim
489dfea99f Update base image in Dockerfile 2025-02-10 22:49:55 +01:00
FuzzyGrim
470385e4a4 fix: update healthcheck interval in Dockerfile from 30s to 10s 2025-02-06 13:34:54 +01:00
FuzzyGrim
6ef5badb9d fix: update healthcheck port in Dockerfile from 80 to 8000 2025-02-06 13:18:25 +01:00
Xila Cai
c5bf935280 324-version-0180-always-timeout (#329)
* Refactor list component layout to use flex-wrap for improved responsiveness

* increase workers and timeout

* add nginx
2025-02-04 20:47:49 +01:00
Xila Cai
3f252b6b98 fix celerybeat-schedule: permission denied (#216)
* fix celerybeat-schedule: permission denied

* fix dockerbuild file
2024-09-17 00:08:19 +02:00
FuzzyGrim
bdd4b5db81 add curl to docker image 2024-05-27 10:28:19 +02:00
FuzzyGrim
f727b4b89a specify port exposed in Dockerfile 2024-05-27 10:22:48 +02:00
FuzzyGrim
428ed19340 close #168; add healthcheck to docker image 2024-05-27 10:12:44 +02:00
FuzzyGrim
69e52b6ca7 import as background tasks with celery 2024-04-25 11:40:43 +02:00
FuzzyGrim
f7e9c81c81 add noinput to collectatic 2024-03-12 15:30:13 +01:00
FuzzyGrim
c18661de1d revert to css 2024-03-06 17:10:24 +01:00
FuzzyGrim
67dc4a8af1 separate redis from src 2024-03-04 18:56:30 +01:00
FuzzyGrim
919d1fe43b add build packages for redislite in arm 2024-02-29 17:46:18 +01:00
FuzzyGrim
3e01afd908 add arm64 support 2024-02-17 20:35:26 +01:00
FuzzyGrim
b572a351ee update docker python version to 3.11 2024-02-17 17:18:42 +01:00
FuzzyGrim
a70875ad98 change default puid and guid to 1000 2023-09-29 21:02:17 +02:00
FuzzyGrim
1942339df1 change to use psycopg binary for faster build 2023-09-29 21:01:36 +02:00
FuzzyGrim
ec856b9bcd move from uwsgi to gunicorn for simpler setup 2023-09-29 21:00:46 +02:00
FuzzyGrim
38025b81e3 drop support for arm docker 2023-08-30 21:50:45 +02:00
FuzzyGrim
984b5c32b0 add packages for piwheels 2023-08-29 23:26:31 +02:00
FuzzyGrim
7aaabf0624 compile scss on dockerfile 2023-08-29 23:09:48 +02:00
FuzzyGrim
5615f8258e change docker directory name to yamtrack 2023-08-26 20:55:47 +02:00
FuzzyGrim
960fffcdd3 change psycopg to psycopg-c (#39)
* change psycopg to psycopg-c

* remove libp5
2023-07-15 18:47:13 +02:00
FuzzyGrim
b7456c11ba fix unknown static directory 2023-07-13 16:19:03 +02:00
FuzzyGrim
86db5baaf2 use python implementation of psycopg 2023-04-29 18:16:55 +02:00
FuzzyGrim
dab467d3c9 use local mime.types file 2023-03-09 22:46:39 +01:00
FuzzyGrim
fe4e3bdde8 add mime type, fixes static files not loading when using reverse proxy 2023-03-09 21:35:27 +01:00
FuzzyGrim
474d0265ab separate dev packages in requirements 2023-03-07 12:57:40 +01:00
FuzzyGrim
997d3c6ab6 docker multi-stage build without libsass and django-compressor 2023-03-07 12:56:48 +01:00
FuzzyGrim
df3c46af8e add armv6 and armv7 docker support 2023-03-06 20:32:57 +01:00
FuzzyGrim
6460f02717 remove nginx and serve static files with uwsgi 2023-03-05 22:12:58 +01:00
FuzzyGrim
d0a91cd8eb redirect nginx logs 2023-02-11 14:31:33 +01:00
FuzzyGrim
d3512989b8 include nginx on main image 2023-02-01 13:54:15 +01:00
FuzzyGrim
88d55705d1 create parent assets folder for static and media 2023-01-27 22:12:01 +01:00
FuzzyGrim
07dc20b8ea add PUID and PGID support 2023-01-27 20:50:13 +01:00
FuzzyGrim
796e3676d6 change to debian slim image 2023-01-26 12:24:08 +01:00