Skip to content

Add Docker image - #183

Open
Neraste wants to merge 49 commits into
developfrom
feature/docker
Open

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

Conversation

@Neraste

@Neraste Neraste commented Dec 30, 2025

Copy link
Copy Markdown
Member

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. I neutralized the migration file, and created a new one. This seems to work for now. I’m wondering if it will break for the next migration. I ran a test that went fine. I’m not sure why this is causing problems;
  • 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

codecov Bot commented Dec 30, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.23810% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 98.54%. Comparing base (c9602a2) to head (1253a40).

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.71%   98.54%   -0.17%     
===========================================
  Files           84       85       +1     
  Lines         2017     1996      -21     
===========================================
- Hits          1991     1967      -24     
- Misses          26       29       +3     

☔ View full report in Codecov by Harness.
📢 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

Neraste commented Mar 8, 2026

Copy link
Copy Markdown
Member Author

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

Neraste commented Apr 6, 2026

Copy link
Copy Markdown
Member Author

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

@Neraste
Neraste marked this pull request as ready for review June 22, 2026 00:12
@Neraste Neraste linked an issue Jul 19, 2026 that may be closed by this pull request
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.

Create a Docker image

2 participants