nolanlawson / pinafore

Alternative web client for Mastodon (UNMAINTAINED)
https://pinafore.social
GNU Affero General Public License v3.0
1.02k stars 173 forks source link

Add Docker image workflow #2301

Closed samsapti closed 1 year ago

samsapti commented 1 year ago

Added a GH Actions workflow to automatically publish Docker images with the following tags:

Closes #2148. Regarding #1284, if you don't want to use Docker Hub, GHCR could be an alternative, since the project is already on GitHub. Having an official Docker image somewhere significantly eases self-hosting.

nolanlawson commented 1 year ago

Thanks for the PR! I have zero knowledge about Docker, so bear with me. :slightly_smiling_face:

Questions:

  1. I suppose I need to create a Docker account and set the env vars for the username/password?
  2. This will run for every commit and tag, as I understand it. I'm a bit concerned this will push me over the limit of my available GitHub Actions budget, which is already being eaten up by the CI tests. But maybe I can turn it off if I start approaching the limit.
  3. How do I advertise this? In the readme? What instructions do I give people? Do I have to create some kind of profile page on Docker itself?
samsapti commented 1 year ago

@nolanlawson no problem at all! I'll try to answer your questions:

  1. Yes, that's correct. You need to create an account and put your credentials in the GH repo secrets.
  2. You can certainly turn it off if you want. Alternatively, we can make it so it only creates a Docker image on git tags / releases (essentially removing the edge image tag, which is the one created on every commit).
  3. I would write it in the README somewhere, and edit your existing docker-compose.yml file to use the official image. Usually people use the README from GH on the Docker image page over on Docker Hub (I actually don't know whether that's a built-in feature on Docker Hub or not).

Also, I forgot to mention, that it also builds the image on pull requests, but without pushing it to Docker Hub, so it's only for testing the build. Also, this only happens when the Dockerfile or the workflow file is edited.

nolanlawson commented 1 year ago

Thanks for the details. It will probably take me quite some time to figure out enough about Docker to set up the account, put the proper instructions in the README, and make the proper modifications to the existing Dockerfile. I can't promise I'll get to this soon.

samsapti commented 1 year ago

@nolanlawson you shouldn't need to modify the Dockerfile. You only need to make an account on Docker Hub, and then create a repo named pinafore. Assuming you'll be using the same username as on GH, I've modified the docker-compose.yml file for you.

I can also help out with the README if you want me too.

Aeolun commented 1 year ago

I came here to make this only to see that someone already did. Thanks @samsapti !