Skip to content

Commit

Permalink
Move npm run build as part of docker build (#129)
Browse files Browse the repository at this point in the history
* Move `npm run build` as part of docker build

* Update mount path to not clobber local build

* Add build_artifacts to gitignore

* remove mis-named build script, and inline command in Dockerfile
  • Loading branch information
AlexAxthelm authored Dec 9, 2024
1 parent 8f88a29 commit 0c1285c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
.vercel
/.svelte-kit
/build
/build_artifacts
/test-results

# Data
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ RUN npm install \
# Copy the source code to the working directory
COPY src ./src
COPY static ./static
COPY scripts ./scripts

CMD ["./scripts/build.sh"]
# Build the application
RUN npm run build

CMD ["cp", "-rv", "/app/build/.", "/mnt/build_artifacts/"]
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
# command: ["sh"]
volumes:
- type: bind
source: ${STATIC_BUILD_PATH:-./build}
source: ${STATIC_BUILD_PATH:-./build_artifacts}
target: /mnt/build_artifacts
read_only: false
network_mode: none
Expand All @@ -20,7 +20,7 @@ services:
- 3000:80
volumes:
- type: bind
source: ${STATIC_BUILD_PATH:-./build}
source: ${STATIC_BUILD_PATH:-./build_artifacts}
target: /usr/share/nginx/html
read_only: false
- type: bind
Expand Down
5 changes: 0 additions & 5 deletions scripts/build.sh

This file was deleted.

0 comments on commit 0c1285c

Please sign in to comment.