From 739f64edf1cf5f403afbe2a47d2200bee5158083 Mon Sep 17 00:00:00 2001 From: David Mang Date: Sun, 1 Sep 2024 15:35:05 +0200 Subject: [PATCH] Change dockerfile path to client --- .github/workflows/build_docker.yml | 4 ++-- client/src/api/insights.api.ts | 8 ++++++++ docker/client/Dockerfile | 4 ++-- docker/server/Dockerfile | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_docker.yml b/.github/workflows/build_docker.yml index d7159e7..2b4ad43 100644 --- a/.github/workflows/build_docker.yml +++ b/.github/workflows/build_docker.yml @@ -19,11 +19,11 @@ jobs: include: - dockerfile: ./docker/client/Dockerfile image: ghcr.io/ls1intum/thaii/client - context: ./docker/client + context: . path: client - dockerfile: ./docker/server/Dockerfile image: ghcr.io/ls1intum/thaii/server - context: ./docker/server + context: . path: server outputs: server_image_tag: "${{ steps.output-tag-server.outputs.server_image_tag }}" diff --git a/client/src/api/insights.api.ts b/client/src/api/insights.api.ts index 739600d..07ad278 100644 --- a/client/src/api/insights.api.ts +++ b/client/src/api/insights.api.ts @@ -1,6 +1,13 @@ import { FilterBody } from "../types/statistics/statistics.types"; import api from "./interceptor.api"; +//@filter: +// - dateRange: Dates included in analysis +// - page: Pages included in analysis +// - labels: Labels included in analysis +// - tags: Tags included in analysis + +// Fetch number of total chats export const fetchTotalChats = async (filter: FilterBody) => { try { const response = await api.post(`/api/v1/insights/total-chats/`, filter); @@ -10,6 +17,7 @@ export const fetchTotalChats = async (filter: FilterBody) => { } }; +// Fetch number of total messages export const fetchTotalMessages = async (filter: FilterBody) => { try { const response = await api.post(`/api/v1/insights/total-messages/`, filter); diff --git a/docker/client/Dockerfile b/docker/client/Dockerfile index d76e21c..24d8c22 100644 --- a/docker/client/Dockerfile +++ b/docker/client/Dockerfile @@ -6,11 +6,11 @@ ENV VITE_API_URL=$VITE_API_URL WORKDIR /client -COPY ./client/package*.json ./ +COPY ../../client/package*.json ./ RUN npm install -COPY ./client . +COPY ../../client . RUN npm run build diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index d5e3784..7485c71 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.12.4-slim-bookworm WORKDIR /server -COPY ./server . +COPY ../../server . RUN python3 -m venv /opt/venv && \ /opt/venv/bin/pip install --upgrade pip && \