Skip to content

Commit

Permalink
Merge pull request #1582 from dodona-edu/fix/docker-compose-web
Browse files Browse the repository at this point in the history
Fix dolos-web Docker image not using the environment variables correctly
  • Loading branch information
rien committed Sep 13, 2024
2 parents aca8414 + c619894 commit d39dfc9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion api/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let
dev = fetchTarball "https://github.com/numtide/devshell/archive/main.tar.gz";
devshell = pkgs.devshell or (import dev { inherit system; });
ruby = pkgs.ruby_3_2;
ruby = pkgs.ruby_3_3;
in
devshell.mkShell {
name = "Dolos API server";
Expand Down
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
15 changes: 6 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
url = "github:numtide/devshell";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};
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
4 changes: 1 addition & 3 deletions web/src/views/analysis/overview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,7 @@ const similarities = computed(() =>
// Average maximum similarity.
const averageSimilarity = computed(() => {
const mean =
similarities.value.reduce((a, b) => a + b, 0) / similarities.value.length ??
0;
const mean = similarities.value.reduce((a, b) => a + b, 0) / similarities.value.length;
return isNaN(mean) ? 0 : mean;
});
Expand Down

0 comments on commit d39dfc9

Please sign in to comment.