Skip to content

Commit b04a39a

Browse files
committed
Remove manual build step
Run `npm run build` while building the container. The compiled artifact is removed from the checked-in code, and added to .gitignore. Bug: T396991
1 parent fc5fbba commit b04a39a

File tree

4 files changed

+14
-183
lines changed

4 files changed

+14
-183
lines changed

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Dockerfile
2-
docker-compose.yml
2+
docker-compose.yml
3+
node_modules

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ terraform.tfstate*
2020
.terraform*
2121
tofu/kube.config
2222
ansible/collections/*
23+
quarry/web/static/templates/compiled.js

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ RUN pip install --break-system-packages --upgrade pip==24.0 wheel && \
2020
USER quarry
2121
COPY . /app
2222

23+
# Build JS assets
24+
RUN apt update && \
25+
apt install -y nodejs npm && \
26+
npm install && \
27+
npm run build && \
28+
# Once the build is run, dependencies are no longer needed, delete them
29+
# to keep image small
30+
rm -rf node_modules && \
31+
apt remove nodejs npm && \
32+
rm -rf /var/lib/apt/lists/*
33+
2334
# Expose port for web server
2435
EXPOSE 5000
2536

quarry/web/static/templates/compiled.js

Lines changed: 0 additions & 182 deletions
This file was deleted.

0 commit comments

Comments
 (0)