Skip to content

Commit

Permalink
Add dev script and Dockerfile.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
qtc-de committed Jul 24, 2024
1 parent f04cb9d commit 876786f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
19 changes: 19 additions & 0 deletions frontend/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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"]
13 changes: 13 additions & 0 deletions frontend/dev.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 876786f

Please sign in to comment.