Skip to content

Commit b541861

Browse files
toufalismarnachwillkg
authored
OBS-504: Optimize Socorro builds for better FE dev speed (#6908)
* OBS-504: reorder docker commands to improve FE build speed * OBS-504: exclude devcontainer from default build target * OBS-504: reorder devcontainer docker commands * Update justfile Co-authored-by: Sven Marnach <sven@marnach.net> * Update justfile Co-authored-by: Will Kahn-Greene <willkg@users.noreply.github.com> --------- Co-authored-by: Sven Marnach <sven@marnach.net> Co-authored-by: Will Kahn-Greene <willkg@users.noreply.github.com>
1 parent 732131b commit b541861

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.devcontainer/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ COPY docker/set_up_stackwalker.sh /tmp/set_up_stackwalker.sh
2727
RUN /tmp/set_up_stackwalker.sh && \
2828
rm /tmp/set_up_stackwalker.sh
2929

30-
# Install frontend JS deps
31-
COPY --chown=app:app ./webapp/package*.json /webapp-frontend-deps/
32-
RUN cd /webapp-frontend-deps/ && npm install
33-
3430
# Install Python dependencies
3531
COPY requirements.txt /app/
3632
RUN pip install --no-cache-dir --no-deps -r requirements.txt && \
@@ -44,3 +40,7 @@ ENV PYTHONUNBUFFERED=1 \
4440
CSSMIN_BINARY=/webapp-frontend-deps/node_modules/.bin/cssmin \
4541
NPM_ROOT_PATH=/webapp-frontend-deps/ \
4642
NODE_PATH=/webapp-frontend-deps/node_modules/
43+
44+
# Install frontend JS deps
45+
COPY --chown=app:app ./webapp/package*.json /webapp-frontend-deps/
46+
RUN cd /webapp-frontend-deps/ && npm install

docker/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ COPY docker/set_up_stackwalker.sh /tmp/set_up_stackwalker.sh
2626
RUN /tmp/set_up_stackwalker.sh && \
2727
rm /tmp/set_up_stackwalker.sh
2828

29-
# Install frontend JS deps
30-
COPY --chown=app:app ./webapp/package*.json /webapp-frontend-deps/
31-
RUN cd /webapp-frontend-deps/ && npm install
32-
3329
COPY --chown=app:app requirements.txt /app/
3430
RUN pip install --no-cache-dir --no-deps -r requirements.txt && \
3531
pip check --disable-pip-version-check
@@ -42,6 +38,10 @@ ENV PYTHONUNBUFFERED=1 \
4238
NPM_ROOT_PATH=/webapp-frontend-deps/ \
4339
NODE_PATH=/webapp-frontend-deps/node_modules/
4440

41+
# Install frontend JS deps
42+
COPY --chown=app:app ./webapp/package*.json /webapp-frontend-deps/
43+
RUN cd /webapp-frontend-deps/ && npm install
44+
4545
# app should own everything under /app in the container
4646
USER app
4747

justfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _env:
1313
fi
1414

1515
# Build docker images
16-
build *args: _env
16+
build *args='app fakesentry oidcprovider elasticsearch postgresql pubsub memcached gcs-emulator': _env
1717
docker compose build --progress plain {{args}}
1818

1919
# Set up Postgres, Elasticsearch, local Pub/Sub, and local GCS services.

0 commit comments

Comments
 (0)