Open MatthK opened 2 years ago
Thanks. I am still not sure how to create Docker image properly so I am thankful for the inspiration. This seems somewhat cleaner than the other PR https://github.com/fossar/selfoss/pull/1170, relying on cron rather than trying to run the update periodically on its own, but I still have unresolved questions before being able to make an official one:
cron
, apache2-foreground
or php-fpm worker (if we introduced one) crashes? It would be nice to have systemd manage the services but AFAICT, only Podman has sort of support for systemd.By the way, if you want to speed up the build a bit, you can use the pre-built image (and you will also get a guarantee of CI passing on it):
version=$(curl https://dl.cloudsmith.io/public/fossar/selfoss-git/raw/index.json | jq '.packages | max_by(.upload_date) | .version' --raw-output)
url="https://dl.cloudsmith.io/public/fossar/selfoss-git/raw/names/selfoss.zip/versions/${version}/selfoss-${version}.zip"
But then it will be harder to re-use for development.
I fear I'm not that much of an expert on Docker either. I previously made a container to have my webfront with Selfoss in one container. Recently someone asked, if it would be possible to update Selfoss to the latest version, to take advantage of the latest features. So I experimented and got this up and running.
I then created this build to have Selfoss only, in case someone didn't want my webfront included.
FROM php:7.4-fpm
. I guess the webserver would have to be added then separately with an apt install
. Alternatively, here is a description of setting up an nginx and php-fpm image: https://blog.ruanbekker.com/blog/2017/08/26/building-a-alpine-nginx-php-fpm-image-on-docker-for-php-applications/
Not an issue at all, but also not sure where else I should put this.
For anyone looking for a docker container, this one here should be working. It works out of the box with the sqlite db, but it should be possible to link it to an existing other database as well.
You can find it here: https://github.com/MatthK/Selfoss-Docker