Skip to content

Commit d39dfc9

Browse files
authored
Merge pull request #1582 from dodona-edu/fix/docker-compose-web
Fix dolos-web Docker image not using the environment variables correctly
2 parents aca8414 + c619894 commit d39dfc9

File tree

6 files changed

+13
-20
lines changed

6 files changed

+13
-20
lines changed

api/shell.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
let
33
dev = fetchTarball "https://github.com/numtide/devshell/archive/main.tar.gz";
44
devshell = pkgs.devshell or (import dev { inherit system; });
5-
ruby = pkgs.ruby_3_2;
5+
ruby = pkgs.ruby_3_3;
66
in
77
devshell.mkShell {
88
name = "Dolos API server";

docker-compose.yml

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
21
name: dolos
3-
version: "3.9"
42
services:
53
db:
64
image: mariadb:11

flake.lock

+6-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
url = "github:numtide/devshell";
1313
inputs = {
1414
nixpkgs.follows = "nixpkgs";
15-
flake-utils.follows = "flake-utils";
1615
};
1716
};
1817
};

web/Dockerfile

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:22.2.0-alpine3.19
1+
FROM node:22.8.0-alpine3.19
22

33
WORKDIR /web/
44

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

1111
ENV VITE_HOST=0.0.0.0
1212
ENV VITE_PORT=8080
13-
ENV VITE_API_URL=http://localhost:3000
1413
ENV VITE_MODE=server
14+
ENV DEFAULT_VITE_API_URL=http://localhost:3000
1515
EXPOSE 8080/tcp
1616

17-
RUN npm run build
17+
RUN VITE_API_URL="$DEFAULT_VITE_API_URL" npm run build
1818

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

web/src/views/analysis/overview.vue

+1-3
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,7 @@ const similarities = computed(() =>
281281
282282
// Average maximum similarity.
283283
const averageSimilarity = computed(() => {
284-
const mean =
285-
similarities.value.reduce((a, b) => a + b, 0) / similarities.value.length ??
286-
0;
284+
const mean = similarities.value.reduce((a, b) => a + b, 0) / similarities.value.length;
287285
return isNaN(mean) ? 0 : mean;
288286
});
289287

0 commit comments

Comments
 (0)