Skip to content

Commit

Permalink
Only copy required files into Docker work directory (#1103)
Browse files Browse the repository at this point in the history
* Only copy required files into Docker work directory

Use `rsync` to exclude copying unnecessary files in to the working
directory. This mainly helps speed up running the containers during
local development since the developer may already have `node_modules`,
`.build`, and `.vscode-test`, all of which can be quite large.
  • Loading branch information
plemarquand authored Sep 27, 2024
1 parent 39beed5 commit b86e3f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8

# dependencies
RUN apt-get update && apt-get install -y curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
RUN apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential

RUN useradd --user-group --create-home --system --skel /dev/null --home-dir /vscode vscode

Expand Down
9 changes: 8 additions & 1 deletion docker/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ set -ex
current_directory=$(pwd)

mkdir /tmp/code
cp -r ./ /tmp/code/
# Add the -v flag to see what is getting copied in to the working folder
rsync -a --exclude "node_modules" \
--exclude "out" \
--exclude "dist" \
--exclude ".git" \
--exclude ".vscode-test" \
--exclude ".build" \
./ /tmp/code/
cd /tmp/code

npm ci
Expand Down

0 comments on commit b86e3f1

Please sign in to comment.