16 Commits

Author SHA1 Message Date
Klaas van Schelven
8594fa2b50 Remove EXPOSE from Dockerfile
it doesn't actually take runtime vars ('-e') into account
https://stackoverflow.com/questions/50178013/docker-expose-using-run-time-environment-variables

we'll just recommend '-p xxxx:xxxx' instead
2024-10-09 10:11:53 +02:00
Klaas van Schelven
4fb14df090 Docker: Port configurable as an env variable 2024-10-03 22:11:50 +02:00
Klaas van Schelven
26276a4a01 Check-before-migrate
do the fast thing, and the read-only thing, first
2024-10-02 23:10:04 +02:00
Klaas van Schelven
83834b8e4b git commit -m "Dockerfile: don't complain about migrations, just migrate
Our goal with having Docker in the first place is to make it easy to
deploy the application. 'just migrating' is a good idea for that goal
in general, but the more so because running migration commands when
the container isn't running yet, while the container refuses to run
without them having run putch you in a catch-22.

(the above may not be strictly true when you run with a database that's
external to your image, i.e. with mysql, because then you can use 'run'
rather than 'exec', but even that feels a bit 'wrongish', because run
starts a container that is then left around for `docker ps -a` to see)

for sqlite containers it's even more pressing, because the writes-to-db
go to different databases for each of the incantations of run (including
server-start). Even if I get this to work (I can't find the solution
in 15 minutes) it will be so clunky to be unworkable.

Theoretical concerns about not migrating on-server-start (but rather,
as part of some CI/CD script or something) will have take take a back-seat
to the reasoning above... if they even hold up at all).
2024-10-02 22:58:42 +02:00
Klaas van Schelven
2e70197825 Add check_migrations command
this way, at least in the Docker setup, you'll get a meaningful error when you
try to start up a half-baked server
2024-09-09 15:31:14 +02:00
Klaas van Schelven
67cfbb58d7 Use 'monofy' package now that it is extracted 2024-09-04 22:54:27 +02:00
Klaas van Schelven
b1baa529d4 Use '&&' and '|||' in server-unified syntax 2024-08-29 08:39:34 +02:00
Klaas van Schelven
4c38473865 server-unified: generalize for serial/parallel approach that is not django-specific 2024-08-29 08:34:06 +02:00
Klaas van Schelven
4e613a943e Port 8000 as the default port _everywhere_
This is more canonical with stuff 'elsewhere on the internet'

we already did it behind-the-scenes for 'recommended gunicorn', so the
harmonization is in having the same default for the rest.
2024-08-28 15:21:00 +02:00
Klaas van Schelven
14ffbb7a48 Docker: configurable using env vars 2024-08-28 12:37:13 +02:00
Klaas van Schelven
98b08cb2e3 Run PYTHONUNBUFFERED
'for good measure'; I've seen this before and remembered it (i.e. I have not
actually observed a need for it this time).

https://stackoverflow.com/a/59812588/339144
2024-08-27 21:57:02 +02:00
Klaas van Schelven
f6c43d4d6d bugsink-server-unified: run in Docker 2024-08-27 21:53:13 +02:00
Klaas van Schelven
e4174d1e64 mysqlclient out of requirements.txt
just install it where we need it, namely in the Docker image
2024-08-27 09:50:31 +02:00
Klaas van Schelven
f20104770e Docker from wheel, not sourcecode
this way we reuse all the thinking we did when getting the Python wheels in order.
* what to include/exclude
* setting up the scripts
2024-08-27 09:48:39 +02:00
Klaas van Schelven
200ea5eb84 Docker image: Ubuntu -> python-slim
* I'd rather harmonize with "the docker way" than with my own recommended setup
* slim: expectation is that this is smaller (not checked)
* this is a 2-stage build (slim has no gcc, needed for mysql)
* PEP668 does not apply here ("externally managed"), which leads to
* better ergonomics: no env/bin/some-command
2024-08-27 09:04:42 +02:00
Klaas van Schelven
d00d007306 Dockerfile(s): the afternoon's progress 2024-08-26 20:37:55 +02:00