Skip to content

Generated Dockerfile can't build assets installed with npm --save #5976

Closed
@mrkurt

Description

@mrkurt

Environment

  • Elixir version (elixir -v): Elixir 1.17.3 (compiled with Erlang/OTP 27)
  • Phoenix version (mix deps): 1.7.14
  • Operating system: MacOS, Docker, and Linux

Actual behavior

I've installed xterm.js with npm i @xterm/xterm --save (straight from the phoenix docs), which placed it in assets/node_modules as expected. When I import this in either my app.css or app.js it works as expected when running in development:

@import "@xterm/xterm";
import { Terminal } from '@xterm/xterm';

When I attempt to build this with Docker, however, it fails because .dockerignore includes this:

# Static artifacts - These should be fetched and built inside the Docker image
/assets/node_modules/

Expected behavior

I'd like my Dockerfile to build my assets properly when I follow the docs for adding using an npm.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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