Skip to content

feat(pages): add Dockerfile for server hosting - #878

Closed
wu21-web wants to merge 8 commits into
alibaba:mainfrom
wu21-web:docker
Closed

feat(pages): add Dockerfile for server hosting#878
wu21-web wants to merge 8 commits into
alibaba:mainfrom
wu21-web:docker

Conversation

@wu21-web

Copy link
Copy Markdown
Contributor

Description

Added a docker container for the pages server, making server starts fast because new it is prebuilt.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring (no functional changes)
  • Documentation update
  • CI / Build / Tooling

How Has This Been Tested?

  • make test passes locally
  • Manual testing (describe below)
    Local Dockerfile build on my mac works (colima+docker) fine, and also added a check-container step with ubuntu-latest runner to check the container.
% docker build -t open-code-review-pages .
[+] Building 20.0s (15/15) FINISHED                                                                                                         docker:colima
 => [internal] load build definition from Dockerfile                                                                                                 0.0s
 => => transferring dockerfile: 450B                                                                                                                 0.0s
 => [internal] load metadata for docker.io/library/nginx:1.27-alpine                                                                                 3.8s
 => [internal] load metadata for docker.io/library/node:22-alpine                                                                                    3.8s
 => [internal] load .dockerignore                                                                                                                    0.0s
 => => transferring context: 126B                                                                                                                    0.0s
 => [build 1/6] FROM docker.io/library/node:22-alpine@sha256:c610fcdfb1d5b4740dd70c284ed3cb16bb857e0f7166196e36a5501df7a3aa32                        0.0s
 => => resolve docker.io/library/node:22-alpine@sha256:c610fcdfb1d5b4740dd70c284ed3cb16bb857e0f7166196e36a5501df7a3aa32                              0.0s
 => CACHED [stage-1 1/3] FROM docker.io/library/nginx:1.27-alpine@sha256:65645c7bb6a0661892a8b03b89d0743208a18dd2f3f17a54ef4b76fb8e2f2a10            0.0s
 => => resolve docker.io/library/nginx:1.27-alpine@sha256:65645c7bb6a0661892a8b03b89d0743208a18dd2f3f17a54ef4b76fb8e2f2a10                           0.0s
 => [internal] load build context                                                                                                                    0.0s
 => => transferring context: 15.09kB                                                                                                                 0.0s
 => [stage-1 2/3] COPY nginx.conf /etc/nginx/conf.d/default.conf                                                                                     0.0s
 => CACHED [build 2/6] WORKDIR /app                                                                                                                  0.0s
 => CACHED [build 3/6] COPY package.json package-lock.json ./                                                                                        0.0s
 => CACHED [build 4/6] RUN npm ci                                                                                                                    0.0s
 => [build 5/6] COPY . .                                                                                                                             0.0s
 => [build 6/6] RUN npm run build                                                                                                                   15.8s
 => [stage-1 3/3] COPY --from=build /app/dist /usr/share/nginx/html                                                                                  0.0s 
 => exporting to image                                                                                                                               0.2s 
 => => exporting layers                                                                                                                              0.1s 
 => => exporting manifest sha256:800ab4afc9409b98b9aa1be4748e68abec131aadc9fcd09724546935c5ac5095                                                    0.0s 
 => => exporting config sha256:9762e0264e7b1b8a28f12ce263c8774478b20fffe28920926ebba19324b537b8                                                      0.0s
 => => exporting attestation manifest sha256:557381c2431e8e856f5002dc925466bfa23866629e3000e753f58232eafbeeba                                        0.0s
 => => exporting manifest list sha256:6cbacfe9ca71f8bdbef1c2f4707a71b0e49731527e82eb01bf11969adbbb9397                                               0.0s
 => => naming to docker.io/library/open-code-review-pages:latest                                                                                     0.0s
 => => unpacking to docker.io/library/open-code-review-pages:latest                                                                                  0.0s

Checklist

  • My code follows the project's coding style (go fmt, go vet)
  • I have performed a self-review of my code
  • I have added tests that prove my fix is effective or my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly (if applicable)
    I think this is not needed for documentation because no customer would ever host a open-code-review pages server themselves
  • I have signed the CLA

Related Issues

none yet

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🔍 OpenCodeReview found 4 issue(s) in this PR.

  • ✅ Successfully posted inline: 4 comment(s)

Comment thread .github/workflows/pages-ci.yml
Comment thread .github/workflows/pages-ci.yml
Comment thread .github/workflows/pages-ci.yml Outdated
Comment thread .github/workflows/pages-ci.yml Outdated
@wu21-web

wu21-web commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

The current container is not pushed, because of I have read-only permissions, anyone with write access can push this to ghcr with a valid token (minimal scope: repo:all & packages:write)

@lizhengfeng101

Copy link
Copy Markdown
Collaborator

Hi @wu21-web, thanks for putting this together! The Dockerfile and nginx setup look solid — nice multi-stage build and sensible caching strategy.

That said, our pages site is currently hosted on GitHub Pages, which already handles building, serving, CDN, and HTTPS for us out of the box. We don't have a self-hosting use case at the moment, so adding a Docker layer would introduce extra maintenance overhead (keeping the Dockerfile, nginx config, and lockfile in sync) without a clear benefit right now.

If we ever move toward self-hosting or need something GitHub Pages can't provide, we'd love to revisit this. For now though, I'm going to close this one.

Thanks again for the contribution!

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