diff --git a/.env.example b/.env.example index 7e44ed76..7afda89b 100644 --- a/.env.example +++ b/.env.example @@ -19,3 +19,7 @@ RAY_DASHBOARD_PORT=${RAY_DASHBOARD_PORT:-8265} # Provide keys for external services as required by your application. MISTRAL_API_KEY=${MISTRAL_API_KEY:-} # Optional: Key for Mistral API access. OPENAI_API_KEY=${OPENAI_API_KEY:-} # Optional: Key for OpenAI API access. + +# Frontend configuration +# URL to connect with the backend +VUE_APP_BASE_URL=http://localhost:8000/api/v1/ diff --git a/Makefile b/Makefile index 6139a5d8..6ffe0c7e 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ start-lumigator: .env # Launches lumigator with no code mounted in, and forces build of containers (used in CI for integration tests) start-lumigator-build: .env - RAY_ARCH_SUFFIX=$(RAY_ARCH_SUFFIX) docker compose --profile local -f $(LOCAL_DOCKERCOMPOSE_FILE) up -d --build + RAY_ARCH_SUFFIX=$(RAY_ARCH_SUFFIX) docker compose --profile local-fe -f $(LOCAL_DOCKERCOMPOSE_FILE) up -d --build # Launches lumigator without local dependencies (ray, S3) start-lumigator-external-services: .env diff --git a/docker-compose.yaml b/docker-compose.yaml index 6cc8b11d..70fef692 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -20,6 +20,7 @@ services: - localstack-data:/var/lib/localstack profiles: - local + - local-fe localstack-create-bucket: image: localstack/localstack:3.4.0 @@ -33,6 +34,7 @@ services: - "localhost:host-gateway" profiles: - local + - local-fe ray: image: rayproject/ray:2.30.0-py311-cpu${RAY_ARCH_SUFFIX} @@ -77,6 +79,7 @@ services: - "localhost:host-gateway" profiles: - local + - local-fe backend: image: mzdotai/lumigator:latest @@ -124,6 +127,21 @@ services: extra_hosts: - "localhost:host-gateway" + frontend: + image: mzdotai/lumigator-frontend:latest + build: + context: . + dockerfile: "./lumigator/frontend/Dockerfile" + target: "server" + depends_on: + backend: + condition: "service_started" + required: true + ports: + - 80:80 + profiles: + - local-fe + volumes: localstack-data: diff --git a/lumigator/frontend/Dockerfile b/lumigator/frontend/Dockerfile index 6f5e7418..5ff64f16 100644 --- a/lumigator/frontend/Dockerfile +++ b/lumigator/frontend/Dockerfile @@ -3,20 +3,20 @@ ARG NODE_VERSION=18.20.0 FROM node:${NODE_VERSION}-alpine AS base # Copy the project into the image -COPY . /frontend +COPY ../../ /mzai -WORKDIR /frontend/ +WORKDIR /mzai/ # Install dependencies -RUN npm install +RUN npm --prefix /mzai/lumigator/frontend install # Build static files -RUN npm run build +RUN npm --prefix /mzai/lumigator/frontend run build FROM nginx:1.27.2-alpine-slim AS server # Copy builded files to the Nginx image -COPY --from=base /frontend/dist /usr/share/nginx/html +COPY --from=base /mzai/lumigator/frontend/dist /usr/share/nginx/html EXPOSE 80