Skip to content

devcontainer support#552

Open
cwhite911 wants to merge 25 commits intoOSGeo:masterfrom
cwhite911:docker-support
Open

devcontainer support#552
cwhite911 wants to merge 25 commits intoOSGeo:masterfrom
cwhite911:docker-support

Conversation

@cwhite911
Copy link
Contributor

@cwhite911 cwhite911 commented Jul 3, 2025

I've add Docker support for running the Hugo server, integrating SCSS for theming, and updating dependencies. Below is a breakdown of the most important changes:

### Development Environment Updates:
* Added HUGO_VERSION to the .env file to specify the Hugo version used in Docker (0.139.4).
* Updated Node.js version in .nvmrc from 22.14.0 to v23.3.0.
* Added instructions in README.md for running Hugo locally with Docker, including commands for installing Node dependencies and launching the Hugo server.

### Docker Integration:
* Introduced a docker-compose.yml file to define a service for running the Hugo server with the hugomods/hugo:dart-sass container, including volume mappings and port configuration.

### Styling and Theming Enhancements:
* Added a new SCSS file (themes/grass/assets/sass/main.scss)
* Updated themes/grass/layouts/partials/head.html to use the SCSS file (main.scss) with Dart Sass for CSS preprocessing, replacing the previous static CSS file.

### Dependency Management:
* Added Bootstrap (^5.3.7) as a dependency in package.json to support modern styling and layout capabilities.

@echoix
Copy link
Member

echoix commented Jul 3, 2025

Sounds like something that would be appropriate to use devcontainers (see the specifications). It can use a docker image directly too, so you’re not that way off

also, using node 23 is kinda weird, node 24 is going to be the LTS at any point now. Otherwise node 22 is used in cases like this

@cwhite911
Copy link
Contributor Author

@echoix Finally got a chance to look at this again. I added a devcontainer and updated dependency management to use npm. Hugo takes a different approach to loading node_modules than I’m used to, so this is an “it works” version and not yet optimized. Ideally, this will make it easier to migrate to the latest Hugo, use Dart Sass, in addition to just normalizing the development and prod environments.

@cwhite911 cwhite911 changed the title Add Docker support for local development devcontainer support Jan 28, 2026
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Are the scss and html changes related to this PR?

@cwhite911
Copy link
Contributor Author

Not anymore, I want this version to represent the current dependencies. I'll then open anther PR to update our Hugo version to the latest version, v0.154.5, add scss compilation. That PR will have breaking changes to some of the current styling so it will need some solid review, but will be worth the update.

Speaking about dependencies. A lot of the current issues are from PR #560 partially updating bootstrap to v5.3 from v4.1 (4.1.3 is still loading).

Let me know if you have any suggestions of additional CI tooling we should add to continue to improve the overall code quality of the site (superlinter, eslint, pre-commit, husky). Also, what are your thoughts about leaving the docker-compose.yml setup with NGINX (still need to finish configuring) for prod testing?

@echoix
Copy link
Member

echoix commented Jan 28, 2026

I don't know where the nginx is mentioned, but looks fine.

The version inconsistencies I was mentioning were between the devcontainer file and the other files that you use, that would be the current versions as you said.

Note that I think the website is still built on the Debian server if I'm up to date (are we pushing the artifacts there now?), so we cannot update all the versions we want without planning.

At least for devcontainer, renovate will help keeping them updated. https://docs.renovatebot.com/modules/manager/devcontainer/

The .nvmrc file too: https://docs.renovatebot.com/modules/manager/nvm/

Docker compose: https://docs.renovatebot.com/modules/manager/docker-compose/

@cwhite911
Copy link
Contributor Author

I don't know where the nginx is mentioned, but looks fine. The version inconsistencies I was mentioning were between the devcontainer file and the other files that you use, that would be the current versions as you said.

Wasn't thinking. I changed them locally but they are not committed.

At least for devcontainer, renovate will help keeping them updated. https://docs.renovatebot.com/modules/manager/devcontainer/
The .nvmrc file too: https://docs.renovatebot.com/modules/manager/nvm/
Docker compose: https://docs.renovatebot.com/modules/manager/docker-compose/

Cool, I'll add these.

Note that I think the website is still built on the Debian server if I'm up to date (are we pushing the artifacts there now?), so we cannot update all the versions we want without planning.

Yes. I believe that is right. That is why I want to setup docker-compose replicate that environment the best we can for testing the built artifacts.

@neteler
Copy link
Member

neteler commented Jan 28, 2026

Note that I think the website is still built on the Debian server ...

Correct

(are we pushing the artifacts there now?),

You mean tarballs and such?

so we cannot update all the versions we want without planning.

What do you need to be updated on the server - can I help?

@cwhite911
Copy link
Contributor Author

@neteler Is the site currently being built by Hugo on the server?

@neteler
Copy link
Member

neteler commented Jan 29, 2026

Here the script, FYI:

https://github.com/OSGeo/grass-addons/blob/grass8/utils/cronjobs_osgeo_lxd/hugo_clean_and_update_job.sh

@cwhite911
Copy link
Contributor Author

Do you want to switch to GitHub actions handling the build so the sever doesn't need to manage Hugo and the other dependencies?

@cwhite911
Copy link
Contributor Author

@echoix is renovate activated on this repo?

@echoix
Copy link
Member

echoix commented Feb 1, 2026

@echoix is renovate activated on this repo?

Only 3 repos have it activated in the OSGeo org. Someone with enough rights need to enable it. I can only see, but not change any settings. So either @wenzeslaus or @neteler can do it. Maybe enable renovate and place the config file (you took the addons one I see) in that on-boarding PR).

@neteler
Copy link
Member

neteler commented Feb 2, 2026

Someone with enough rights need to enable it.

Done so: #591
@echoix feel free to edit the renovate.json therein.

@cwhite911 cwhite911 marked this pull request as ready for review February 3, 2026 16:16
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Why is the devcontainer PR still containing so much website/css/javascript/content changes?

@cwhite911
Copy link
Contributor Author

Why is the devcontainer PR still containing so much website/css/javascript/content changes?

I'm removing the static dependencies from themes/grass/static/plugins (bootstrap, popper, etc..). They are installed with npm now.

This was referenced Feb 6, 2026
@echoix
Copy link
Member

echoix commented Feb 6, 2026

npm ci means clean install. It flushes existing node_modules and only uses the package-lock.json. If you didn’t have the package-lock up to date, that’s why it might not have worked. It would usually be the recommended way, npm install would change to install different dependencies over time. If the setup doesn’t work with npm ci, it will become a problem sooner or later

@cwhite911 cwhite911 added the enhancement New feature or request label Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants