Skip to content

Commit

Permalink
Let dolos-web rebuild if different VITE_API_URL is given
Browse files Browse the repository at this point in the history
  • Loading branch information
rien committed Sep 13, 2024
1 parent 9401cee commit c619894
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

name: dolos
version: "3.9"
services:
db:
image: mariadb:11
Expand Down
9 changes: 5 additions & 4 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:22.2.0-alpine3.19
FROM node:22.8.0-alpine3.19

WORKDIR /web/

Expand All @@ -10,10 +10,11 @@ RUN npm install && apk add --no-cache curl

ENV VITE_HOST=0.0.0.0
ENV VITE_PORT=8080
ENV VITE_API_URL=http://localhost:3000
ENV VITE_MODE=server
ENV DEFAULT_VITE_API_URL=http://localhost:3000
EXPOSE 8080/tcp

RUN npm run build
RUN VITE_API_URL="$DEFAULT_VITE_API_URL" npm run build

CMD npm run preview -- --host "$VITE_HOST" --port "$VITE_PORT" --strictPort

CMD (test "$VITE_API_URL" == "$DEFAULT_VITE_API_URL" || npm run build) && npm run preview -- --host "$VITE_HOST" --port "$VITE_PORT" --strictPort

0 comments on commit c619894

Please sign in to comment.