run collectstatic in Dockerfile
This is an alternative for !23 (closed). So now we have three options how to run collectstatic
:
-
current master: the static files are not included in the dockerfile.
collectstatic
must be executed by the admin, e.g. in a docker-compose file. - this: the static files are included in the web container. Just like in (1), they need to be made available to nginx, e.g. using a volume.
-
!23 (closed): the process is split into two steps: First, we execute
collectstatic
. Second, we build two docker containers: One with the application code and another containing nginx and the static files.
When comparing (2) and (3) I see two major questions:
- Should the static files be grouped with the application (group by topic) or with nginx (group by functionality)?
- Should we execute
collectstatic
on the source code inside docker (simple) or should we runcollectstatic
(and build a wheel) outside of docker and then install them (clean)?
I personally prefer the topic/simple combination. We can still build a more complex/clean solution if it becomes necessary.