Skip to content

fix: index.html and marketing assets not served in Docker deployment #466

@Adityatorgal17

Description

@Adityatorgal17

Bug Description

When running Maglev via Docker, GET / returns 404 index.html not found
instead of the welcome page.

Root Cause

index.html and marketing/ are copied into the builder stage via COPY . ., but the runtime stage
(based on alpine:3.21) only explicitly copies the binary and
config.example.json. Static web assets are never transferred to the final
image.

Additionally, marketing/ was listed in .dockerignore which would have
prevented it from reaching the builder stage in a fresh build context.

Steps to Reproduce

  1. Clone the repo
  2. cp config.docker.example.json config.docker.json
  3. docker compose up
  4. curl http://localhost:4000/

Expected: Welcome page HTML (status 200)
Actual: index.html not found (status 404)

Proposed Fix

  • Add COPY --from=builder /build/index.html ./index.html to the runtime stage in Dockerfile
  • Add COPY --from=builder /build/marketing/ ./marketing/ to the runtime stage in Dockerfile
  • Remove marketing/ from .dockerignore so it is available in the builder stage

I have a fix ready and will open a PR referencing this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions