Skip to content

Production build fails without dev dependencies #652

@scheibling

Description

@scheibling

Describe the bug

I'll prefix this with I'm a bit of a newcomer here and admittedly not even close to an expert on anything frontend-related, so I apologize if this might be a non-issue 🙂

The frontend container build is currently not reproducible with just the code + Dockerfile, you have to yarn install without --production/--frozen-lockfile outside or in a separate container before running the actual build (as done in the actions workflow) - for example the autoprefixer package seems to be missing from the dependencies on the production side.

This could from my understanding, depending on the OS the image is built on, cause a bunch of discrepancies in how the application is built over time and between machines.

To Reproduce

Steps to reproduce the behavior:

  1. Clone the repository
  2. Go to the frontend repo
  3. Run docker build -t phase-local/frontend:latest .
  4. Receive error

Expected behavior

Reproducible container builds based on the checked-in code and Dockerfile no matter the underlying OS and NodeJS version/package manager outside the container

Also

RUN cp -R node_modules /tmp/node_modules
This line could likely be removed, it was made redundant by optimizations made in b584d31

Screenshots

Image

Platform you are having the issue on:

Additional context

Tried with both main, v2.52.0

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions