Skip to content

Docker deployment setup - #128

Draft
ramonechen wants to merge 13 commits into
main-previewfrom
deployment-setup
Draft

Docker deployment setup#128
ramonechen wants to merge 13 commits into
main-previewfrom
deployment-setup

Conversation

@ramonechen

@ramonechen ramonechen commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

This pull request standardizes Compose, Dockerfile, and .dockerignore file formats to be in line with deployment setups of the API and SIS scraper repositories.

Changes include:

  • Using an inclusion pattern in .dockerignore instead of the old exclusion pattern
  • Adding clarifying comments to the Dockerfile
  • Repurposing the Dockerfile for production environments
  • Adding an image build and publish workflow
  • Enhancing the Compose file by explicitly defining a container name, image pull and restart policies
  • Adding a top-level comment to the Compose file explaining how to start the development environment
  • Enforcing a npm version of 11.12.x to comply with the project's package-lock.json

mirmirmirr and others added 8 commits April 22, 2026 14:52
Add drawers and miscellaneous refinements
Instead of blacklisting files, I adopted the popular whitelist approach that really minifies build size by only keeping the bare necessities needed to build the image.
By default, Node v24.14.0 is bundled with an older version of npm. This line simply updates npm to the version expected by the project's package-lock.json.
Gave the Compose stack and container explicit names, and overall made the file format consistent with the API and SIS scraper configurations.
@ramonechen
ramonechen requested review from Copilot and mirmirmirr and removed request for Copilot April 24, 2026 06:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Standardizes the project’s Docker/Compose setup (and related CI) to match the deployment conventions used in other CARPI repositories.

Changes:

  • Updates docker-compose.yml with clearer dev-environment instructions and more explicit container/image settings.
  • Adjusts Dockerfile to pin npm (per package-lock.json) and adds clarifying build/run comments.
  • Adds a GitHub Actions workflow to build/publish the Docker image, and switches .dockerignore to an allowlist approach.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
docker-compose.yml Renames service and clarifies dev workflow; adds container/image policies and updates volume mounts.
Dockerfile Pins npm version, changes workdir to /site, and documents build/run steps.
.github/workflows/image-publish.yml Adds a reusable workflow call to build/push an image to GHCR on main pushes.
.dockerignore Switches to allowlist-based build context to standardize what’s sent to Docker builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile Outdated
Comment thread docker-compose.yml Outdated
Comment thread .github/workflows/image-publish.yml
Comment thread .github/workflows/image-publish.yml
@ramonechen
ramonechen requested a review from mirmirmirr April 24, 2026 14:39
To separate dev and prod builds cleanly.
The serve application is very inefficient compared to using NGINX to serve the static files built by `npm build`. Therefore, this commit aims to eliminate the use of serve and the entire Node.js runtime in the production image produced by the Dockerfile.

A new build stage has been added to the Dockerfile to build the static files that will be served in production. The production stage has been refactored to use a fresh image with only NGINX to serve those files from the build stage, eliminating the weight of the Node.js runtime.

A custom nginx.conf has also been added to provide basic server configuration for the new NGINX server. It simply listens on port 80, and serves the static files within the container.
@ramonechen
ramonechen marked this pull request as draft April 28, 2026 23:10
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.

3 participants