mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-18 18:51:16 +02:00
Merge pull request #567
feat(docker:dev): npm dependencies are installed when container starts
This commit is contained in:
@@ -3,9 +3,9 @@ FROM node:lts-alpine
|
||||
WORKDIR /usr/src/frontend
|
||||
|
||||
COPY ./frontend/package.json ./frontend/package-lock.json ./
|
||||
|
||||
RUN npm ci --verbose && npm cache clean --force
|
||||
COPY ./docker/dev/vite/entrypoint.sh /usr/local/bin/vite-entrypoint
|
||||
RUN chmod +x /usr/local/bin/vite-entrypoint
|
||||
|
||||
ENV PATH ./node_modules/.bin/:$PATH
|
||||
|
||||
CMD ["npm", "run", "dev"]
|
||||
ENTRYPOINT ["vite-entrypoint"]
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
deps_hash="$(sha256sum package.json package-lock.json | sha256sum | cut -d ' ' -f 1)"
|
||||
deps_stamp="node_modules/.wygiwyh-deps-hash"
|
||||
|
||||
if [ ! -f "$deps_stamp" ] || [ "$(cat "$deps_stamp")" != "$deps_hash" ]; then
|
||||
echo "Installing frontend dependencies..."
|
||||
npm ci --no-audit --no-fund --prefer-offline
|
||||
printf '%s\n' "$deps_hash" > "$deps_stamp"
|
||||
fi
|
||||
|
||||
exec npm run dev
|
||||
Reference in New Issue
Block a user