discourse_docker.git
6 months agoMerge branch 'main' into fsf-master fsf-master
Anush V [Tue, 6 May 2025 20:11:13 +0000 (16:11 -0400)]
Merge branch 'main' into fsf-master

Upgrading discourse

6 months agoClarified SMTP-related comments in samples/standalone.yml (#948)
Philo Gray [Tue, 6 May 2025 01:23:26 +0000 (21:23 -0400)]
Clarified SMTP-related comments in samples/standalone.yml (#948)

This is just a small change and goes along with changes to docs at
https://meta.discourse.org/t/troubleshoot-email-on-a-new-discourse-install/16326.

6 months agoBump Ruby to 3.3.7 (#954)
Alan Guo Xiang Tan [Tue, 6 May 2025 01:22:32 +0000 (09:22 +0800)]
Bump Ruby to 3.3.7 (#954)

7 months agoFIX: Setup swap when RAM <= 4GB (#953)
Rafael dos Santos Silva [Thu, 17 Apr 2025 18:04:27 +0000 (15:04 -0300)]
FIX: Setup swap when RAM <= 4GB (#953)

8 months agoDrop `pry` as default runtime console. (#947)
Alan Guo Xiang Tan [Tue, 4 Mar 2025 04:28:25 +0000 (12:28 +0800)]
Drop `pry` as default runtime console. (#947)

Using `pry` as the default runtime console in the production environment
is forcing us to account for it in Discourse core's codebase. In order
to avoid the additional complexity in Discourse core's codebase, we have
decided to drop `pry` as the default runtime console and rely on IRB
which is just as good these days. We will however be keeping the
dependency on `pry` around so those that would like to use it can start
it manually.

8 months agoUpdate README.md (#942)
Ella E. [Mon, 3 Mar 2025 06:18:35 +0000 (23:18 -0700)]
Update README.md (#942)

Include blurb about hosting.

Internal: /t/122265/

8 months agoRemoving unicorn service from phpbb template broke the build (#934)
Jay Pfaffman [Thu, 27 Feb 2025 16:24:26 +0000 (10:24 -0600)]
Removing unicorn service from phpbb template broke the build (#934)

* Removing unicorn service from phpbb template broke the build

https://meta.discourse.org/t/migrate-a-phpbb3-forum-to-discourse/30810/786?u=pfaffman

* Prevent Sidekiq from running

Usually we don't want Sidekiq to run during an import because it might mess things up while there's incomplete or inconsistent data.

---------

Co-authored-by: Gerhard Schlager <gerhard.schlager@discourse.org>
9 months agoBump default base image to 2.0.20250226-0128 (#946)
Jarek Radosz [Wed, 26 Feb 2025 11:02:42 +0000 (12:02 +0100)]
Bump default base image to 2.0.20250226-0128 (#946)

9 months agoDEV: Re-add ghostscript to the base image (#945)
Jarek Radosz [Wed, 26 Feb 2025 01:28:38 +0000 (02:28 +0100)]
DEV: Re-add ghostscript to the base image (#945)

9 months agoDEV: Use more recent version of libheif (#943)
Jarek Radosz [Wed, 26 Feb 2025 00:17:03 +0000 (01:17 +0100)]
DEV: Use more recent version of libheif (#943)

9 months agoDEV: Launcher Cleanup - Remove redundant word in error message (#944)
SouthpawKB [Tue, 25 Feb 2025 21:26:10 +0000 (16:26 -0500)]
DEV: Launcher Cleanup - Remove redundant word in error message (#944)

9 months agoUpdate firefox tar format (#939)
David Taylor [Tue, 11 Feb 2025 12:11:29 +0000 (12:11 +0000)]
Update firefox tar format (#939)

Firefox started distributing `.tar.xz` instead of `.tar.bz2`

9 months agoFIX: web.ssl.template compat with latest core (#938)
David Taylor [Tue, 4 Feb 2025 20:01:48 +0000 (20:01 +0000)]
FIX: web.ssl.template compat with latest core (#938)

https://github.com/discourse/discourse/commit/649505d869ff7a04d894fb2322428d0cfb82100e added some new content between `listen 80;` and `gzip on;`, which broke these replacements.

This commit reorders & updates the replacements so that they should work reliably with versions of core before and after that change.

9 months agoDEV: Force PNPM v9 to be installed. (#937)
Gary Pendergast [Tue, 4 Feb 2025 07:17:32 +0000 (18:17 +1100)]
DEV: Force PNPM v9 to be installed. (#937)

Before upgrading PNPM to v10, we need to get Docker builds running again, so this change temporarily forces PNPM v9 to be installed.

9 months agoFIX: attempt the postgresql update if a stale socket file exists (#935)
mwaniki-wairungu [Mon, 3 Feb 2025 11:45:51 +0000 (14:45 +0300)]
FIX: attempt the postgresql update if a stale socket file exists (#935)

9 months agoFIX: install pgvector package for old PG versions during update (#932)
mwaniki-wairungu [Wed, 29 Jan 2025 15:32:39 +0000 (18:32 +0300)]
FIX: install pgvector package for old PG versions during update (#932)

9 months agoBump default base image to discourse/base:2.0.20250129-0720 (#931)
mwaniki-wairungu [Wed, 29 Jan 2025 08:53:40 +0000 (11:53 +0300)]
Bump default base image to discourse/base:2.0.20250129-0720 (#931)

Follow-up to d9c837c783b06ae33d949f9dc50db187ba3d6337

9 months agoFEATURE: Update base image and set default to postgresql 15 (#909)
mwaniki-wairungu [Wed, 29 Jan 2025 07:20:49 +0000 (10:20 +0300)]
FEATURE: Update base image and set default to postgresql 15 (#909)

This updates the default PostgreSQL version to 15.

  * image/base: update default postgres version to 15
  * launcher: bump base image to include postgres 15
  * postgres.template.yml: update default version to 15
  * postgres.15.template.yml: current version template

Legacy version templates:

  * postgres.13.template.yml
  * postgres.12.template.yml
  * postgres.10.template.yml
  * postgres.9.5.template.yml

9 months agoDEV: Update ImageMagick to 7.1.1-43 (#929)
Jarek Radosz [Tue, 28 Jan 2025 11:07:56 +0000 (12:07 +0100)]
DEV: Update ImageMagick to 7.1.1-43 (#929)

We could use a bump, after two years since the last one.

9 months agoDEV: Update nginx to 1.26.1 (#930)
Jarek Radosz [Tue, 28 Jan 2025 11:07:44 +0000 (12:07 +0100)]
DEV: Update nginx to 1.26.1 (#930)

9 months agoFix TLS in socketed template (#925)
nta~ [Tue, 28 Jan 2025 00:59:53 +0000 (01:59 +0100)]
Fix TLS in socketed template (#925)

After 7d548ad4ae3022863262f485505a32df13df1983, the replacement pattern in web.socketed.template.yml no longer matches, making nginx.https.sock not exist.

As such, remove the `http2` field from the `listen` directive to match aforementioned commit.

9 months agoDEV: Update the workflow to Ubuntu 24.04 (#928)
Jarek Radosz [Tue, 28 Jan 2025 00:58:35 +0000 (01:58 +0100)]
DEV: Update the workflow to Ubuntu 24.04 (#928)

The current LTS

10 months agoFIX: use appropriate manifest for pg-15 image from 8a956d4bb
Mwaniki Wairungu [Mon, 27 Jan 2025 09:40:00 +0000 (12:40 +0300)]
FIX: use appropriate manifest for pg-15 image from 8a956d4bb

Follow-up to ab957b2f64b8252e18a657e2e5abe0cff087b38a

10 months agoPush docker manifest for `discourse/base:2.0.${{ env.TIMESTAMP }}-15` (#926)
Alan Guo Xiang Tan [Mon, 27 Jan 2025 08:41:30 +0000 (16:41 +0800)]
Push docker manifest for `discourse/base:2.0.${{ env.TIMESTAMP }}-15` (#926)

Follow-up to ab957b2f64b8252e18a657e2e5abe0cff087b38a

10 months agoDEV: bump timeout for non-scheduled builds (#924)
Michael Fitz-Payne [Fri, 24 Jan 2025 01:21:00 +0000 (11:21 +1000)]
DEV: bump timeout for non-scheduled builds (#924)

The most recent build timed out at 30 minutes. Bump timeout temporarily
to get a gauge on how long self-hosted builds take (push to Dockerhub
looks to be slower than Github-hosted runners).

10 months agoDEV: switch amd64 builds to debian-12 runners
Michael Fitz-Payne [Tue, 21 Jan 2025 04:31:32 +0000 (14:31 +1000)]
DEV: switch amd64 builds to debian-12 runners

We can use our self-hosted action/runner machines to build the amd64
Docker images, falling back to the Github action/runner machines for the
arm64 builds.

Additionally, simplify the expression for how arm runners are selected.
The cost savings from switching to self-hosted runners dwarfs the
increase in 8core vs 2core arm runners.

10 months agoRevert "Add new Nginx config to base image (#918)" (#923)
Bianca Nenciu [Thu, 23 Jan 2025 07:46:29 +0000 (09:46 +0200)]
Revert "Add new Nginx config to base image (#918)" (#923)

We have decided to go another route and keep the Nginx config in the
Discourse repository, but add the outlets there.

This reverts commit 32dc866c85682cffdf9a6ec2eb69cd91a175e120.

10 months agoAdd new Nginx config to base image (#918)
Bianca Nenciu [Wed, 22 Jan 2025 18:13:17 +0000 (20:13 +0200)]
Add new Nginx config to base image (#918)

This commit moves the Nginx config from discourse/discourse repository
and updates it with several 'include' statements that serve as extension
outlets.

This change was made to place the config closer to where it is used and
implements an alternative to the "find & replace" hacks.

It is unused at this moment, but all templates and samples will be
updated in a future commit.

10 months agoDEV: Correct manifest name for images with PG 15 installed (#919)
Alan Guo Xiang Tan [Tue, 21 Jan 2025 08:01:07 +0000 (16:01 +0800)]
DEV: Correct manifest name for images with PG 15 installed (#919)

Follow-up to ab957b2f64b8252e18a657e2e5abe0cff087b38a

10 months agoBuild images with PG 15 installed (#917)
Alan Guo Xiang Tan [Tue, 21 Jan 2025 01:59:32 +0000 (09:59 +0800)]
Build images with PG 15 installed (#917)

This commit updates the build workflow to build and push an extra base Docker
image with PG 15 installed. The tag is not meant to be permanent and is
just meant to help us update our postgres templates to support PG 15
within the same commit.

The tag will be removed once our `discourse/base:release` ships with PG
15 by default.

10 months agoDEV: Remove invalid comment (#916)
Alan Guo Xiang Tan [Thu, 16 Jan 2025 00:48:16 +0000 (08:48 +0800)]
DEV: Remove invalid comment (#916)

This script is used by the build workflow which invalidates the comment

10 months agoDEV: Remove unused docker images (#915)
Jarek Radosz [Wed, 15 Jan 2025 23:52:39 +0000 (00:52 +0100)]
DEV: Remove unused docker images (#915)

1. `monitor` uses a 9 year old base image
2. `discourse_fast_switch` uses a 6 year old base image and references ruby 2.4 and 2.5
3. `discourse_bench` uses an 8 year old base image and references postgres 9.5

10 months agoDEV: Minor cleanup of the workflow (#914)
Jarek Radosz [Wed, 15 Jan 2025 20:46:02 +0000 (21:46 +0100)]
DEV: Minor cleanup of the workflow (#914)

10 months agoSeparate nginx build step (#908)
Jeff Wong [Tue, 14 Jan 2025 21:29:19 +0000 (13:29 -0800)]
Separate nginx build step (#908)

* Revert "Revert "Move nginx installation into another build step (#897)" (#899)"

This reverts commit 0e767585d634f0442438ecd1250804b0572dad1c.

* add nginx runtime dependencies

10 months agoRevert "Add nginx config file and support for outlets (#871)" (#912)
David Taylor [Tue, 14 Jan 2025 16:44:52 +0000 (16:44 +0000)]
Revert "Add nginx config file and support for outlets (#871)" (#912)

This reverts commit 01cbf07622c45106109e6339c8a65e957b6fed5d.

10 months agoAdd nginx config file and support for outlets (#871)
Bianca Nenciu [Tue, 14 Jan 2025 15:56:45 +0000 (17:56 +0200)]
Add nginx config file and support for outlets (#871)

The nginx config file used to be copied from the discourse/discourse
repository, but it has been now moved in this project, closer to the
place where it is used.

The config has several 'include' statements that implement support for
outlets that templates can then use to extend the default configuration
for various features. This is an alternative to the "find & replace"
hacks.

10 months agoBump default base image to discourse/base:2.0.20250114-0014
Jarek Radosz [Tue, 14 Jan 2025 13:56:33 +0000 (14:56 +0100)]
Bump default base image to discourse/base:2.0.20250114-0014

10 months agoFEATURE: Update node to version 22.x (#910)
Jarek Radosz [Mon, 13 Jan 2025 13:01:08 +0000 (14:01 +0100)]
FEATURE: Update node to version 22.x (#910)

10 months agoDEV: Periodic bump of launcher (#906)
Alan Guo Xiang Tan [Tue, 7 Jan 2025 06:18:56 +0000 (14:18 +0800)]
DEV: Periodic bump of launcher (#906)

10 months agoBump Redis to 7.0.15 (#907)
Alan Guo Xiang Tan [Tue, 7 Jan 2025 05:46:53 +0000 (13:46 +0800)]
Bump Redis to 7.0.15 (#907)

Pulls in bug and security fixes since 7.0.7

11 months agoClean up firefox tar file in `discourse/discourse_test` image (#904)
Alan Guo Xiang Tan [Fri, 27 Dec 2024 04:51:33 +0000 (12:51 +0800)]
Clean up firefox tar file in `discourse/discourse_test` image (#904)

11 months agoRemove `git reset --hard` command in web template to reduce layer size (#903)
Alan Guo Xiang Tan [Mon, 23 Dec 2024 08:52:19 +0000 (16:52 +0800)]
Remove `git reset --hard` command in web template to reduce layer size (#903)

I noticed that use running `git reset --hard` results in ~133MB being
added to the final layer generated by `launcher bootstrap`. However, I
can not figure out why we would need to run `git reset --hard` at all.

Even if there is a reason to run `git reset --hard`, it should not be
the default. If someone for whatever reason needs to run `git reset
--hard`, they should do so using the `before_code` hook.

To replicate the problem, one can run the following steps:

1. In the `discourse_docker` repository, create a file named `containers/test.yml` with the following contents:

```
base_image: discourse/base:2.0.20241223-0016

run:
  - exec: sudo -H -E -u discourse bash -c "cd /var/www/discourse && git reset --hard"
```

2. Run `./launcher bootstrap test`
3. Run `docker history local_discourse/test` and see that the new layer created by `./launcher bootstrap` is roughly 133MB.

```
IMAGE          CREATED         CREATED BY                                      SIZE      COMMENT
012471f3c5e4   2 minutes ago   /bin/bash -c /usr/local/bin/pups --stdin        133MB
```

11 months agoRun `npmp prune` and `bundle clean` to clean up unused files (#902)
Alan Guo Xiang Tan [Mon, 23 Dec 2024 08:38:59 +0000 (16:38 +0800)]
Run `npmp prune` and `bundle clean` to clean up unused files (#902)

pnpm packages and bundle gems can add significant size to the Docker
image. Ensure that we clean up those unused files to ensure we don't
add extra diskspace to the final layer when bootstrapping.

11 months agoRevert "FIX: Set the Host header in the nginx.conf upstream block"
Michael Brown [Thu, 19 Dec 2024 20:49:36 +0000 (15:49 -0500)]
Revert "FIX: Set the Host header in the nginx.conf upstream block"

This reverts commit d8a363b60e92fff3ba2338daa6cdb1b04bff3680.

Support for this was removed in nginx - I was unintentionally testing on an old version

11 months agoFIX: Set the Host header in the nginx.conf upstream block
Michael Brown [Thu, 19 Dec 2024 19:53:04 +0000 (14:53 -0500)]
FIX: Set the Host header in the nginx.conf upstream block

Using e.g. `proxy_pass http://discourse` resets the Host header on the upstream
request to `discourse`.

This would break multisites, so we don't want that; the most effetive way to
ensure it's set properly is to `set_header` in the upstream block.

11 months agoRevert "Move nginx installation into another build step (#897)" (#899)
Alan Guo Xiang Tan [Thu, 19 Dec 2024 02:19:13 +0000 (10:19 +0800)]
Revert "Move nginx installation into another build step (#897)" (#899)

This reverts commit d9633894300a55ab2bc3d35a4b986a11d4bc1fa6.

This broke certain assumptions like the `/etc/nginx` directory
exists.

11 months agoPrint docker history summary in build actions (#898)
Alan Guo Xiang Tan [Wed, 18 Dec 2024 01:09:50 +0000 (09:09 +0800)]
Print docker history summary in build actions (#898)

It is useful to know what the size of each layer is after the image has
been built.

11 months agoMove nginx installation into another build step (#897)
Alan Guo Xiang Tan [Tue, 17 Dec 2024 23:07:26 +0000 (07:07 +0800)]
Move nginx installation into another build step (#897)

Avoids polluting the main image with nginx's build dependencies

11 months agoRemove updating of rubygems (#896)
Alan Guo Xiang Tan [Tue, 17 Dec 2024 06:54:12 +0000 (14:54 +0800)]
Remove updating of rubygems (#896)

This adds an additional layer of 20mb for no reason. We don't need to be
running the latest version of rubygems all the time.

Even if we need to update rubygems, it should be updated in https://github.com/discourse/docker-ruby

11 months agoOnly parse a single line from lscpu to get the Cpu(s) count. Avoid localization....
Gullumluvl [Tue, 17 Dec 2024 06:02:21 +0000 (07:02 +0100)]
Only parse a single line from lscpu to get the Cpu(s) count. Avoid localization. (#879)

11 months agoImagemagick enable delegate build and disabled using shared libraries (#889)
Jeff Wong [Tue, 17 Dec 2024 05:28:54 +0000 (21:28 -0800)]
Imagemagick enable delegate build and disabled using shared libraries (#889)

compiles to a single portable binary

Create a base builder package with compile time dependencies. Create an
imagemagick_builder to build imagemagick.

The base builder can be extended for other builders.

Add imagemagick runtime dependencies to discourse_dependencies image
avoid -dev libs

Statically compile as much as possible with --disable-shared and
--enable-delegate-build flags.
References:
https://stackoverflow.com/questions/47031789/imagemagick-100-static-build-for-linux
https://www.imagemagick.org/discourse-server/viewtopic.php?t=14259

Add fonts-urw-base35 for NimbusSans-Regular, needed for letter avatar generation

Copy over the resulting magick bin, as well as etc and share files from the
compilation. etc is needed for magick to run, share is not, but contains
translations for errors which Discourse tests are dependent on reading from.

Create symlinks for other magick tooling - imagemagick creates symlink tool
names that Discourse uses. These *could* be dropped if Discourse decided to use
`magick {toolname}` rather than `{toolname}`.

Add nginx compile dependency - building nginx still needs libfreetype6
This was implicitly installed previously. Removing the imagemagick build from
base broke the next nginx build. Add this dependency back in. This dependency
can be removed once we build nginx separately as well.

11 months agoDEV: Bump rust version to 1.82.0 (#894)
Alan Guo Xiang Tan [Mon, 16 Dec 2024 23:57:38 +0000 (07:57 +0800)]
DEV: Bump rust version to 1.82.0 (#894)

This is to resolve an error we are seeing in our arm64 dev builds

```
24 49.46 error: package `apple-xar v0.20.0` cannot be built because it requires rustc 1.81 or newer, while the currently active rustc version is 1.75.0
24 49.46 Either upgrade to rustc 1.81 or newer, or use
```

11 months agoDEV: Periodic bump of launcher base image (#893)
Alan Guo Xiang Tan [Tue, 10 Dec 2024 02:39:20 +0000 (10:39 +0800)]
DEV: Periodic bump of launcher base image (#893)

Pulls in various fixes and updates

11 months agoInstall `postgresql-client-${PG_MAJOR}` instead of `postgresql-client` (#892)
Alan Guo Xiang Tan [Tue, 3 Dec 2024 02:51:15 +0000 (10:51 +0800)]
Install `postgresql-client-${PG_MAJOR}` instead of `postgresql-client` (#892)

This ensures that the client tools we installed are compatible with the
version of the Postgres cluster.

12 months agoMove source for launcher2 to its own repository. (#890)
Jeff Wong [Tue, 19 Nov 2024 04:37:27 +0000 (20:37 -0800)]
Move source for launcher2 to its own repository. (#890)

12 months agojemalloc build with install_lib_shared libraries (#888)
Jeff Wong [Wed, 13 Nov 2024 01:54:29 +0000 (17:54 -0800)]
jemalloc build with install_lib_shared libraries (#888)

Only output shared lib libraries, we should not need static libraries

12 months agoBump Ruby to 3.3.6 (#885)
Alan Guo Xiang Tan [Wed, 13 Nov 2024 00:49:34 +0000 (08:49 +0800)]
Bump Ruby to 3.3.6 (#885)

This is a routine update that includes minor bug fixes.

See https://www.ruby-lang.org/en/news/2024/11/05/ruby-3-3-6-released/

12 months agoFEATURE: print out compressed image sizes for amd64 (#887)
Jeff Wong [Mon, 11 Nov 2024 07:10:49 +0000 (23:10 -0800)]
FEATURE: print out compressed image sizes for amd64 (#887)

print out compressed image sizes for amd64 in a build step for PRs. Allows for PRs to be automatically reviewed for space efficiency

12 months agoDEV: slim image by dropping building jhead from source, and dropping optipng (#884)
Jeff Wong [Fri, 8 Nov 2024 03:41:21 +0000 (19:41 -0800)]
DEV: slim image by dropping building jhead from source, and dropping optipng (#884)

jhead from apt pulls in a ton of packages, and optipng isn't used. Reduces compressed image size by 8MB.

main: 648.38MB
compiling jhead + dropping optipng: 640.14MB

12 months agoDEV: Remove cache mounts from image/base Dockerfile (#883)
Alan Guo Xiang Tan [Thu, 7 Nov 2024 23:27:55 +0000 (07:27 +0800)]
DEV: Remove cache mounts from image/base Dockerfile (#883)

There are no substantial benefits from using cache mounts here so we
are dropping those mounts.

12 months agoDEV: slim image, drop unused packages and use cache mounts (#880)
Jeff Wong [Mon, 4 Nov 2024 18:49:58 +0000 (10:49 -0800)]
DEV: slim image, drop unused packages and use cache mounts (#880)

* DEV: slim image, drop unused packages and use cache mounts

apt using caches for /var/cache/apt, /var/cache/debconf, and var/lib/apt.

Drop autoconf and build-essential from installs, in favor of selective cmake,
g++, pkg-config, and patch packages.

drop apt-get -y upgrade in dockerfile. We should inherit upgrades from base
images. No need to apt-mark hold initscripts now that we're not running `upgrade`

Remove calls to vim as we no longer install vim here. Remove comment for
slimming locales as we have now done so.

merge all apt layers, minimizing amount of --mount arguments in dockerfile

13 months agoFix Warnung: the "listen ... http2" directive is deprecated (#873)
Tealk [Wed, 16 Oct 2024 02:17:43 +0000 (04:17 +0200)]
Fix Warnung: the "listen ... http2" directive is deprecated (#873)

* Fix Warnung: the "listen ... http2" directive is deprecated

Signed-off-by: Tealk <tealk@anzah.email>
* Update templates/web.ssl.template.yml

Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
* add on to http2

---------

Signed-off-by: Tealk <tealk@anzah.email>
Co-authored-by: Alan Guo Xiang Tan <gxtan1990@gmail.com>
13 months agoDEV: generate only en_us locales (#855)
Jeff Wong [Tue, 15 Oct 2024 06:19:13 +0000 (15:19 +0900)]
DEV: generate only en_us locales (#855)

install locales-all installs 245MB
Generating common and en_us locales installs 22MB

update locales for postgres templates

`locale-gen $LANG` doesn't seem to actually do anything without updates to
`/etc/locale.gen`. Update the scripts to uncomment $LANG before running `update-locale`.

13 months agoDEV: force disable precompile on configure (#876)
Jeff Wong [Mon, 30 Sep 2024 12:46:23 +0000 (05:46 -0700)]
DEV: force disable precompile on configure (#876)

Configure option does a precompile, which should forcefully disable
`PRECOMPILE_ON_BOOT` to prevent unnecessary precompile on boot when
`PRECOMPILE_ON_BOOT` env is set in templates.

14 months agoFix the broken build (#870)
Alan Guo Xiang Tan [Mon, 9 Sep 2024 12:47:50 +0000 (20:47 +0800)]
Fix the broken build (#870)

Follow-up to b47bd562cc03961f3208d09c7e00cbbe40b94092

`Error response from daemon: No such image:
discourse/base:2.0.20240909-1149-arm6`

14 months agoRelease `discourse/base` images for `discourse/discourse` stable branch (#864)
Alan Guo Xiang Tan [Mon, 9 Sep 2024 11:49:14 +0000 (19:49 +0800)]
Release `discourse/base` images for `discourse/discourse` stable branch (#864)

This commit updates our `build` workflow to push the following manifests
which can be used to run Discourse against the stable branch.

1. discourse/base:2.0.$TIMESTAMP-stable
2. discourse/base:release-stable

Co-authored-by: David Taylor <david@taylorhq.com>
14 months agoImprove node_modules cleanup logic for stable branch (#869)
David Taylor [Mon, 9 Sep 2024 10:13:18 +0000 (11:13 +0100)]
Improve node_modules cleanup logic for stable branch (#869)

- makes decision based on current state of directory, instead of `$version`
- cleans up the correct directories
- only cleans up the contents. This is important if node_modules directores are mounted volumes (e.g. in devcontainer)

14 months agoDEV: export default base image (#868)
Jeff Wong [Mon, 9 Sep 2024 06:11:55 +0000 (23:11 -0700)]
DEV: export default base image (#868)

allows default base image to be more portable.

14 months agoAdded support of Linux on Mac with ARM processors (#631)
cheungtitus [Mon, 9 Sep 2024 02:09:20 +0000 (10:09 +0800)]
Added support of Linux on Mac with ARM processors (#631)

Co-authored-by: TItus Cheung <cheungtitus@kenrui-group.com>
14 months agoUpdate Discourse installation support in China (pnpm) (#867)
Jeremy [Fri, 6 Sep 2024 16:10:52 +0000 (00:10 +0800)]
Update Discourse installation support in China (pnpm) (#867)

This commit updates 2 things.
1. Updates the yarn hook to replace the npm mirror before `pnpm install`.
2. Removes the `yarn.lock` patch as pnpm is now used.

After applying these modifications, I successfully installed Discourse on the Tencent Cloud China server. No more network problems.

14 months agoSuppress pnpm upgrade notices in logs (#866)
David Taylor [Fri, 6 Sep 2024 09:28:15 +0000 (10:28 +0100)]
Suppress pnpm upgrade notices in logs (#866)

14 months agoClean up nginx folder after installation. (#865)
Alan Guo Xiang Tan [Fri, 6 Sep 2024 07:09:59 +0000 (15:09 +0800)]
Clean up nginx folder after installation. (#865)

14 months agoDEV: update golang versions (#863)
Jeff Wong [Thu, 5 Sep 2024 00:08:17 +0000 (17:08 -0700)]
DEV: update golang versions (#863)

update golang versions and bump dependencies

14 months agoFEATURE: add an option for custom namespaces (#862)
Jeff Wong [Wed, 4 Sep 2024 13:42:02 +0000 (06:42 -0700)]
FEATURE: add an option for custom namespaces (#862)

Add an option to select a targeted namespace, env var DISCOURSE_NAMESPACE

Configure:
Add `source-tag` to select which tag to configure from.
Rename old `tag` option to `target-tag` to differentiate from `source-tag` option

Migrate:
Add `tag` to select which tag to migrate with

14 months agoReduce min docker version to 20.10.0 (#861)
Alan Guo Xiang Tan [Wed, 4 Sep 2024 03:35:26 +0000 (11:35 +0800)]
Reduce min docker version to 20.10.0 (#861)

Follow up to 31931deae8fc05b4d4c0ab8489596179f4ae3421

Docker 20.10.0 works for now so be less aggressive in forcing people to
upgrade.

14 months agoDEV: Bump minimal Docker version to 24.0.7 (#860)
Alan Guo Xiang Tan [Wed, 4 Sep 2024 02:47:58 +0000 (10:47 +0800)]
DEV: Bump minimal Docker version to 24.0.7 (#860)

When running the newer Debian bookworm based images, we are seeing
`(ThreadError) can't create Thread: Operation not permitted` errors when
trying to spawn a thread in Ruby.

A similar issue was reported in https://github.com/docker-library/ruby/issues/429#issuecomment-1708908819
and the fix here is to upgrade Docker. Either way, we should probably
update because Docker 17 has been EOF for many many years.

14 months agoadd tmp directory to gitignore (#859)
Jeff Wong [Tue, 3 Sep 2024 04:12:34 +0000 (21:12 -0700)]
add tmp directory to gitignore (#859)

14 months agoFEATURE: add autocomplete (#857)
Jeff Wong [Tue, 3 Sep 2024 01:54:14 +0000 (18:54 -0700)]
FEATURE: add autocomplete (#857)

14 months agoFEATURE: add runtime features (#849)
Jeff Wong [Mon, 2 Sep 2024 22:09:38 +0000 (15:09 -0700)]
FEATURE: add runtime features (#849)

adds commands for: start, run, stop, cleanup, destroy, logs, enter, restart, rebuild -- carrying over existing run commands from launcher1.

Rebuild will also do its best to minimize downtime with the following steps:

* Detect if Discourse is running as a single container or external DB
* Detect if db:migrate is configured to run on container boot
* Build initial container (keeping existing one online)
* Exit running containers if it's a single container (otherwise keeps existing online)
* Run migrations
  * Defer migrations if db:migrate is configured to run on container boot
  * Run migrations with SKIP_POST_DEPLOYMENT_MIGRATIONS=1 if it's a 2 container setup
  * Otherwise, run all migrations
* Destroy the old container (finally stopping the current, if it's still up here)
* Start the new container
* Run post-deploy migrations
  * Run migrations with SKIP_POST_DEPLOYMENT_MIGRATIONS=0 if it's a 2 container setup

14 months agoDEV: install redis data folder if none exists (#804)
Jeff Wong [Mon, 2 Sep 2024 20:19:43 +0000 (13:19 -0700)]
DEV: install redis data folder if none exists (#804)

14 months agoMake compatible with pnpm (#854)
David Taylor [Mon, 2 Sep 2024 19:55:57 +0000 (20:55 +0100)]
Make compatible with pnpm (#854)

Switches behavior based on the presence of `yarn.lock`

See https://github.com/discourse/discourse/pull/28671

14 months agoSwitch to `discourse/ruby:3.3.4-bookworm-slim` (#853)
Alan Guo Xiang Tan [Mon, 2 Sep 2024 03:49:43 +0000 (11:49 +0800)]
Switch to `discourse/ruby:3.3.4-bookworm-slim` (#853)

14 months agoDEV: remove bundle cache (#852)
Jeff Wong [Sat, 31 Aug 2024 01:05:34 +0000 (18:05 -0700)]
DEV: remove bundle cache (#852)

On the current image this removes ~78MB from the layer

Uncompressed image sizes:
before: 3.3GB
after: 3.23GB

14 months agoRemove use of `discourse/base:aarch64` in launcher2 (#851)
Alan Guo Xiang Tan [Fri, 30 Aug 2024 02:03:17 +0000 (10:03 +0800)]
Remove use of `discourse/base:aarch64` in launcher2 (#851)

Since fc61b8a850e0a7f8c1ef0852a13d735121b4d862, we started shipping
manifests for the `discourse/base` images so we don't have to
specifically pull the tag for arm64.

14 months agoDrop `mac-os` tests for launcher_go (#850)
Alan Guo Xiang Tan [Fri, 30 Aug 2024 00:39:27 +0000 (08:39 +0800)]
Drop `mac-os` tests for launcher_go (#850)

The runners cost 10 times more and there are no macOS specific tests
which we are running.

14 months agoFEATURE: Add workflow for `launcher_go` (#848)
Jeff Wong [Thu, 29 Aug 2024 07:59:12 +0000 (00:59 -0700)]
FEATURE: Add workflow for `launcher_go` (#848)

14 months agoFEATURE: add migrate and bootstrap commands (#842)
Jeff Wong [Thu, 29 Aug 2024 03:01:28 +0000 (20:01 -0700)]
FEATURE: add migrate and bootstrap commands (#842)

Adds command for migrate only. Adds batch commands for bootstrap (build+migrate+configure)

14 months agoDEV: remove oxipng archive in layer (#846)
Jeff Wong [Thu, 29 Aug 2024 02:34:24 +0000 (19:34 -0700)]
DEV: remove oxipng archive in layer (#846)

* DEV: remove oxipng archive in layer

Saves ~52MB for the layer

* DEV: Remove nginx archives

Remove another 1.2MB from image

14 months agoDEV: Improve assertions of `cli_build_test.go` (#844)
Alan Guo Xiang Tan [Wed, 28 Aug 2024 17:02:49 +0000 (01:02 +0800)]
DEV: Improve assertions of `cli_build_test.go` (#844)

This commit improves the assertions by testing against the entire
command string and env so that we can be sure of the full command we are
running.

15 months agoIncrease timeout for scheduled build job (#845)
David Taylor [Wed, 28 Aug 2024 09:19:59 +0000 (10:19 +0100)]
Increase timeout for scheduled build job (#845)

Now that base & dev images are built in the same job, we need a little more time

15 months agoDEV: Minor readability improvements to launcher2 (#843)
Alan Guo Xiang Tan [Wed, 28 Aug 2024 06:20:17 +0000 (14:20 +0800)]
DEV: Minor readability improvements to launcher2 (#843)

15 months agoFEATURE: add configure command (#841)
Jeff Wong [Wed, 28 Aug 2024 05:13:39 +0000 (22:13 -0700)]
FEATURE: add configure command (#841)

Add 'configure' command - If run after the "build" command, this is equivalent to today's 'bootstrap' command.

Note that unlike build command, a docker run+commit pattern needs to be used here as this requires a running database + mounted volumes.

15 months ago[WIP] Launcher2 (#791)
Jeff Wong [Mon, 26 Aug 2024 19:36:41 +0000 (12:36 -0700)]
[WIP] Launcher2 (#791)

Partial merge of Launcher2's CLI

* FEATURE: merge launcher2 - build command

merge launcher2, only build commands

15 months agoFix timeout for arm64 builds not correctly set (#839)
Alan Guo Xiang Tan [Mon, 26 Aug 2024 07:05:20 +0000 (15:05 +0800)]
Fix timeout for arm64 builds not correctly set (#839)

15 months agoBase image in launcher (#838)
Alan Guo Xiang Tan [Mon, 26 Aug 2024 05:22:33 +0000 (13:22 +0800)]
Base image in launcher (#838)

This pulls in the Nginx 1.26.1 update, Ruby 3.3.4 update and Debian
bookworm update.

15 months agoDEV: Introduce arm64 dev image and multi-arch manifests (#829)
David Taylor [Mon, 26 Aug 2024 05:10:28 +0000 (06:10 +0100)]
DEV: Introduce arm64 dev image and multi-arch manifests (#829)

- Combines dev image build into the `base` job
- Calculates a single timestamp for all builds
- Pushes timestamped per-arch images to Dockerhub for base, base-slim and dev images
- If both arch build jobs are successful, multiarch manifests are generated & pushed

15 months agoUpdate GitHub actions runners to ubuntu-22.04 (#837)
David Taylor [Thu, 22 Aug 2024 10:09:50 +0000 (11:09 +0100)]
Update GitHub actions runners to ubuntu-22.04 (#837)

15 months agoBump Ruby to 3.3.4 (#836)
Alan Guo Xiang Tan [Thu, 22 Aug 2024 04:25:15 +0000 (12:25 +0800)]
Bump Ruby to 3.3.4 (#836)

Ruby 3.3.4 has fixes for some regressions in 3.3.3. I don't think it
affects us but still good to upgrade.

15 months agoSwitch to debian:bookworm-slim image (#831)
Alan Guo Xiang Tan [Thu, 22 Aug 2024 02:57:56 +0000 (10:57 +0800)]
Switch to debian:bookworm-slim image (#831)

Debian Bullseye is EOL.

15 months agoEnsure uid, gid for postgres, redis and discourse stays consistent (#835)
Alan Guo Xiang Tan [Thu, 22 Aug 2024 02:57:29 +0000 (10:57 +0800)]
Ensure uid, gid for postgres, redis and discourse stays consistent (#835)

When updating to `debian/base:bookworm` from `debian/base:bullseye`, we
noticed that the uid of the `postgres` and `redis` user changed leading
to permission issues when trying to access directories of mounted volumn
which was previously created with the old uid. The change is because the
`_apt` user is assigned a uid of `42` in Debian bookworm instead of `100`
in Debian bullseye. As a result, the `postgres` user created by the `postgres`
package is automatically assigned a uid of `100` in Debian bookworm instead of `101` in Debian
bullseye.

This commit updates the `slim.Dockefile` to manually add the `postgres`
user and group assigning it a gid of `104` and uid of `101`. The `redis`
user and group is assigned a uid of `103` and a gid of `106`. The
`discourse` user and group is assigned a uid of `1000` and gid of
`1000`.