Skip to content

Make Dockerfile.dev built containers a drop-in for production images.#682

Merged
Apollon77 merged 1 commit into
matter-js:mainfrom
rspier:docker1
Jun 1, 2026
Merged

Make Dockerfile.dev built containers a drop-in for production images.#682
Apollon77 merged 1 commit into
matter-js:mainfrom
rspier:docker1

Conversation

@rspier

@rspier rspier commented May 26, 2026

Copy link
Copy Markdown
Contributor

Without this change, you can't easily swap a dev container for a production (release) container because there are fundamental differences. Allowing it to be a drop-in replacement makes it easier to test on real fabrics.

  • Use the same (environment variable) mechanism for configuring the default data path for consistent overrides.
  • Use the same uid (1000) so permissions match.
  • Add --ignore-scripts to npm ci to prevent build lifecycle scripts from running before source code is copied.

@Apollon77

Copy link
Copy Markdown
Collaborator

Thanks. Is this a braking change for devcontainer users?

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

This PR updates the development Docker image (Dockerfile.dev) to behave like the production/release image, making it easier to swap dev and prod containers when testing against real fabrics.

Changes:

  • Align runtime configuration with production by using environment variables (not CLI args) for defaults like STORAGE_PATH.
  • Run the container as non-root with UID/GID 1000:1000 and pre-create /data with matching ownership.
  • Change dependency install to npm ci --ignore-scripts to avoid lifecycle scripts running before the source tree is copied in.

Comment thread docker/matterjs-server/Dockerfile.dev
Without this change, you can't easily swap a dev container for a production
(release) container because there are fundamental differences.  Allowing it
to be a drop-in replacement makes it easier to test on real fabrics.

- Use the same (environment variable) mechanism for configuring the default
  data path for consistent overrides.
- Use the same uid (1000) so permissions match.
- Add --ignore-scripts to npm ci to prevent build lifecycle scripts from
  running before source code is copied.
@rspier

rspier commented May 31, 2026

Copy link
Copy Markdown
Contributor Author

Thanks. Is this a braking change for devcontainer users?

Probably. If someone is running a devcontainer and all of the files created by the (old) container are root owned, they won't be readable by the new 1000 running job.

@Apollon77

Copy link
Copy Markdown
Collaborator

Ok I will add info in changelog

@Apollon77 Apollon77 merged commit 0efc390 into matter-js:main Jun 1, 2026
17 checks passed
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