Skip to content

Conversation

@siddharthvp
Copy link
Collaborator

@siddharthvp siddharthvp commented Jun 18, 2025

Run npm run build while building the container. The compiled artifact is removed from the checked-in code, and added to .gitignore.

Bug: T396991

@siddharthvp siddharthvp requested a review from supertassu June 18, 2025 16:30
@siddharthvp siddharthvp force-pushed the js-build branch 6 times, most recently from 9520bb8 to e05e3da Compare June 18, 2025 17:24
@siddharthvp
Copy link
Collaborator Author

(sorry about the email spam - the build runs very slowly on my local, so I was doing repeated force pushes for testing in CI)

supertassu
supertassu previously approved these changes Jun 20, 2025
Copy link
Member

@supertassu supertassu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generally looks good, except for the one thing inline. This seems like a good use case for a multi-stage build instead of pulling Npm in the main image, but I'm fine with this approach as well.

Can you deploy this yourself or should I?

Dockerfile Outdated
COPY . /app

# Build JS assets
RUN apt update && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: apt-get should be used in favour of apt in scripts

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Run `npm run build` while building the container. The compiled artifact
is removed from the checked-in code, and added to .gitignore.

Bug: T396991
Change-Id: I5dbb1da8561ef44384afe84319eb6dfb168123f8
Copy link
Member

@supertassu supertassu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, slight problem: this breaks the local development environment where docker-compose mounts the local folder over the file generated at build time.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants