Skip to content

Add Docker image#183

Draft
Neraste wants to merge 43 commits into
developfrom
feature/docker
Draft

Add Docker image#183
Neraste wants to merge 43 commits into
developfrom
feature/docker

Conversation

@Neraste
Copy link
Copy Markdown
Member

@Neraste Neraste commented Dec 30, 2025

This PR adds a Dockerfile and deployment files to run the server and the front in production within a Docker image.

  • Dockerfile;
  • Configuration;
  • Custom configuration;
  • Logs format harmonisation;
  • APScheduler;
  • Redis;
  • Environment variables prefix;
  • MySQL;
    • Problem with the Player cache object that must have a migration file;
  • Access logs to file;
  • Run as a non-root user?
  • Do not use supervisor;
  • Separate configuration and configuration samples;
  • Add config version check;
  • Manage email by URL;
  • Fix static files;
  • Fix CSRF token;
  • Fix static files for dev;
  • Allow to use local front archive in Dockerfile.

@Neraste Neraste added this to the 1.10.0 milestone Dec 30, 2025
@Neraste Neraste self-assigned this Dec 30, 2025
@Neraste Neraste added enhancement New feature or request release Anything related to releases or release process labels Dec 30, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 30, 2025

Codecov Report

❌ Patch coverage is 93.10345% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.52%. Comparing base (5a30ab6) to head (e14648e).

Files with missing lines Patch % Lines
dakara_server/playlist/signals.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #183      +/-   ##
===========================================
- Coverage    98.69%   98.52%   -0.18%     
===========================================
  Files           83       83              
  Lines         1994     1965      -29     
===========================================
- Hits          1968     1936      -32     
- Misses          26       29       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

odrling added 2 commits March 8, 2026 15:15
In our deployment in kubernetes[1] we usually use the standard output of
the service which is captured by k8s, so the logs can be read from any
tool in the k8s ecosystem.
Setting LOG_FILE_PATH to /dev/stdout doesn’t work as RotatingFileHandler
needs a seekable file to work correctly (needs to tell the current file
position to rotate the logs when it writes to the file).

So this allows to use the standard output for logs when LOG_TO_CONSOLE is
set to True. The way it’s done the logfile is still defined and
therefore initialised when the server starts. In practice creating an
empty file on startup is not a concern and can be avoided by setting
LOG_FILE_PATH to /dev/null (in this case it wouldn’t write to the file
and so it won’t try to rotate it). This could also be changed trivially
to allow to use both the logfile and console for server logs.

[1]: https://github.com/Japan7/nanak8s
was testing that before committing and forgot about it
@Neraste
Copy link
Copy Markdown
Member Author

Neraste commented Mar 8, 2026

I’m wondering if the supervisord approach is the good one, even if it’s the most advised one when you search for Docker with Django and Daphne...

@Neraste
Copy link
Copy Markdown
Member Author

Neraste commented Apr 6, 2026

I eventually moved from supervisor to having several containers from the same image. It’s cleaner as it removes one level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request release Anything related to releases or release process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants