diff --git a/frontend/Dockerfile.dev b/frontend/Dockerfile.dev new file mode 100644 index 0000000..fd695f0 --- /dev/null +++ b/frontend/Dockerfile.dev @@ -0,0 +1,19 @@ +FROM node:lts-alpine + +WORKDIR /app +COPY package*.json . + +RUN adduser --gecos '' --disabled-password rpv \ + && chown -R rpv:rpv /app \ + && su rpv -c "npm install" \ + && su rpv -c "npm install http-server" + +COPY . . + +RUN chown -R rpv:rpv /app \ + && su rpv -c "npm run build" + +USER rpv:rpv +EXPOSE 5173 + +CMD ["npm", "run", "dev", "--", "--host"] diff --git a/frontend/dev.sh b/frontend/dev.sh new file mode 100755 index 0000000..62e1cf7 --- /dev/null +++ b/frontend/dev.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +podman image exists rpv-web-dev + +if [ $? -ne 0 ]; then + echo '[+] Building rpv-web-dev image.' + podman build -t rpv-web-dev -f Dockerfile.dev . +else + echo '[+] rpv-web-dev image already exists.' +fi + +echo '[+] Starting rpv-web-dev container.' +podman run -v ${PWD}/src/:/app/src:Z -it -p 5173:5173 rpv-web-dev