Skip to content

fix(docker): build deployment image from source - #23

Open
RerankerGuo wants to merge 1 commit into
acmenlei:masterfrom
RerankerGuo:fix/issue-17-docker-source-build
Open

fix(docker): build deployment image from source#23
RerankerGuo wants to merge 1 commit into
acmenlei:masterfrom
RerankerGuo:fix/issue-17-docker-source-build

Conversation

@RerankerGuo

Copy link
Copy Markdown

Summary

Fixes #17.

The Docker image currently copies the repository's tracked dist/ directory. Its index.html is a historical deployment stub that redirects every self-hosted request to https://codecv.top, so the documented local Docker deployment never serves the local application.

Changes

  • build the current frontend source in a dedicated Node 22 stage
  • copy only the generated dist/ into the existing Apache runtime image
  • exclude local dependencies, stale build output, Git metadata, and tracker files from the Docker build context

This keeps the runtime image static and small while removing the tracked deployment artifact as a source of truth.

Verification

  • npm ci
  • npm run build
  • verified the generated dist/index.html contains a module entry point and no location.href/codecv.top redirect
  • verified all 21 local assets referenced by the generated HTML exist
  • verified the Dockerfile contains the expected two stages and copies /app/dist/ into Apache

Docker itself is not available in the local test environment, so the container was not started end to end. The exact build-stage commands were run from a clean archive of master.

Scope

  • no application runtime behavior is changed
  • no generated dist/ files are committed
  • PDF export and authentication still require their respective backend services and are outside this fix

Build the frontend in a dedicated Node stage so self-hosted images no longer serve the redirect-only tracked dist bundle. Exclude local build artifacts and metadata from the Docker context.

Closes acmenlei#17

Test: npm ci && npm run build
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.

Local Docker deployment redirect to https://codecv.top

1 participant