phoenixframework / phoenix

Peace of mind from prototype to production
https://www.phoenixframework.org
MIT License
21.45k stars 2.88k forks source link

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

Open mrkurt opened 1 week ago

mrkurt commented 1 week ago

Environment

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.