Skip to content

Prebuilt docker images with Github Actions - #199

Open
Ser-Zar wants to merge 1 commit into
developfrom
feature/rebuilt-docker-images
Open

Prebuilt docker images with Github Actions#199
Ser-Zar wants to merge 1 commit into
developfrom
feature/rebuilt-docker-images

Conversation

@Ser-Zar

@Ser-Zar Ser-Zar commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

#184

This pull request implements the requested CI/CD pipeline for Docker images and simplifies the setup process for end-users.

Changes:

  • Added a new workflow (docker-publish.yml) to automatically build and publish backend, celery, and proxy images to the GitHub Container Registry
  • Removed the legacy docker-compose.yml and introduced a new compose.yml that pulls the prebuilt images from GHCR instead of building them from source
  • Decided that users will place docker_settings.py next to the compose.yml file. Updated the ImportError message in docker_server_overrides.py to reflect this
  • Updated docs/docker.md and internal docs. Added instructions for users to fetch the required setup files (compose.yml and docker_settings.py.example) directly from the repository using curl

Comment thread docs/src/admin/docker.md
mkdir gutenberg && cd gutenberg

# Download compose.yml
curl -O [https://raw.githubusercontent.com/KSIUJ/gutenberg/main/compose.yml](https://raw.githubusercontent.com/KSIUJ/gutenberg/main/compose.yml)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot use annotated links inside code blocks in markdown.

Docker reduce the disk space used by the images.

are used to select versions of the base images. The same versions should albo be used
when specifying image versions in `compose.yml`. Using common versions let's Docker reduce the disk space used by the images.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I made a typo here

Suggested change
when specifying image versions in `compose.yml`. Using common versions let's Docker reduce the disk space used by the images.
when specifying image versions in `compose.yml`. Using common versions lets Docker reduce the disk space used by the images.

Comment thread compose.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this PR remove the existing commits? Also the new commits clearly indicate the changes requested from an AI agent and are not actually useful for admins.

Comment thread compose.yml
file: ./secrets/postgres_password.txt
gutenberg_django_secret_key:
file: ./secrets/django_secret_key.txt
file: ./secrets/django_secret_key.txt No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the removal of the trailing new line here

Suggested change
file: ./secrets/django_secret_key.txt
file: ./secrets/django_secret_key.txt

Comment thread compose.yml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest also keeping a development version of the compose.yml file which builds the images from the repo instead of using published images.

Comment thread docs/src/admin/docker.md
Comment on lines -29 to -46
```bash
cp backend/gutenberg/settings/docker_settings.py.example backend/gutenberg/settings/docker_settings.py
```
In `docker_settings.py`, fill in the following fields properly:
* `ALLOWED_HOSTS` - list of hosts that can connect to the app
* `CSRF_TRUSTED_ORIGINS` - list of trusted origins for CSRF protection

In addition, the value of `SECRET_KEY` will by default be read from the Docker secret
`gutenberg_django_secret_key`. It should be set to a unique random string.
An example of how to generate one can be found below in the [docker-compose.yml](#docker-composeyml) section.

For example:
```python
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
CSRF_TRUSTED_ORIGINS = [
'http://127.0.0.1:3000',
'http://localhost:3000',
]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove this section? It is still applicable, only the path of the settings file might be different.

Comment thread compose.yml
dockerfile: Dockerfile
target: run_backend
# Use published image instead of building from source
image: ghcr.io/ksiuj/gutenberg-backend:main

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure ksiuj will be lowercase here? The name of our GitHub org is KSIUJ (all caps)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments call the repo ksiuj/gutenberg, but the org name is uppercase (KSIUJ not ksiuj). See:
https://github.com/KSIUJ/gutenberg/pull/199/changes#r3786809342

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please describe the automatic publishing of images here. Especially:

  1. when are the images built?
  2. how are the images labelled, and tagged (versioned)?
  3. do we have a latest or stable tag?

Comment thread compose.yml
dockerfile: Dockerfile
target: run_backend
# Use published image instead of building from source
image: ghcr.io/ksiuj/gutenberg-backend:main

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggesting the use of the main tag is not a great idea. When we release breaking changes, a config referencing main might break.
It's also imperative that users use the same version of all images.

I suggest using an env variable like GUTENBERG_VERSION to solve both of these problems. This way we don't need to update the tags in the example compose.yml each time a new version of Gutenberg is released, while the version tag is configured for all containers at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants