diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5655891..108afa0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -17,27 +17,41 @@ jobs: - name: Build and push the Docker image uses: docker/build-push-action@v2 - env: - REACT_APP_ISEE_API: https://api-dev.isee4xai.com/api - REACT_APP_ISEE_ONTOAPI: https://api-onto-dev.isee4xai.com/api with: push: true file: Dockerfile.dev tags: isee4xai/cockpit:dev build-args: | - REACT_APP_ISEE_API=https://api-dev.isee4xai.com/api - REACT_APP_ISEE_ONTOAPI= https://api-onto-dev.isee4xai.com/api + UMI_APP_API_URL="https://api-dev.isee4xai.com/api" + UMI_APP_ONTOAPI_URL="https://api-onto-dev.isee4xai.com/api" + UMI_APP_WS_URL="wss://dialog-dev.isee4xai.com/ws/" + UMI_APP_EDITOR_URL="https://editor-dev.isee4xai.com/" + + - name: Build and push the Docker image (with LLM-enabled Dialog Manager) + uses: docker/build-push-action@v2 + with: + push: true + file: Dockerfile.dev + tags: isee4xai/cockpit-llm:dev + build-args: | + UMI_APP_API_URL="https://api-dev.isee4xai.com/api" + UMI_APP_ONTOAPI_URL="https://api-onto-dev.isee4xai.com/api" + UMI_APP_WS_URL="wss://dialog-llm-dev.isee4xai.com/ws/" + UMI_APP_EDITOR_URL="https://editor-dev.isee4xai.com/" + deploy: needs: build runs-on: ubuntu-latest - name: Deploy on dev platform + steps: - - uses: distributhor/workflow-webhook@v2 - env: - webhook_url: ${{ secrets.WEBHOOK_URL_DEV }} - webhook_secret: ${{ secrets.WEBHOOK_TOKEN_DEV }} - data: '{"DOCKER_SERVICE":"cockpit"}' - webhook_type: 'json-extended' - + - name: Deploy on dev platform + uses: distributhor/workflow-webhook@v2 + with: + env: + webhook_url: ${{ secrets.WEBHOOK_URL_DEV }} + webhook_secret: ${{ secrets.WEBHOOK_TOKEN_DEV }} + data: '{"DOCKER_SERVICE":"cockpit cockpit-llm"}' + webhook_type: 'json-extended' + diff --git a/Dockerfile.dev b/Dockerfile.dev index 1a4390c..23d68b8 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -3,16 +3,15 @@ FROM node:16-alpine as builder WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH -#ARG REACT_APP_ISEE_API -ENV REACT_APP_ISEE_API=https://api-dev.isee4xai.com/api - -#ARG REACT_APP_ISEE_ONTOAPI -ENV REACT_APP_ISEE_ONTOAPI=https://api-onto-dev.isee4xai.com/api +ARG UMI_APP_API_URL="https://api-dev.isee4xai.com/api" +ARG UMI_APP_ONTOAPI_URL="https://api-onto-dev.isee4xai.com/api" +ARG UMI_APP_WS_URL="wss://dialog-dev.isee4xai.com/ws/" +ARG UMI_APP_EDITOR_URL="https://editor-dev.isee4xai.com/" COPY package.json ./ RUN npm i COPY . ./ -RUN cross-env REACT_APP_ISEE_API=https://api-dev.isee4xai.com/api REACT_APP_ISEE_ONTOAPI=https://api-onto-dev.isee4xai.com/api npm run build +RUN npm run build # production environment FROM nginx:stable-alpine diff --git a/src/services/isee/api.config.ts b/src/services/isee/api.config.ts index f3b22d5..e5457c3 100644 --- a/src/services/isee/api.config.ts +++ b/src/services/isee/api.config.ts @@ -1,13 +1,5 @@ -export const BASE_URL = process.env.NODE_ENV === 'production' ? - 'https://api-dev.isee4xai.com/api' - : 'http://localhost:3000/api'; +export const BASE_URL = process.env.UMI_APP_API_URL || 'http://localhost:3000/api'; +export const ONTOAPI_URL = process.env.UMI_APP_ONTOAPI_URL || 'http://localhost:3100/api'; +export const WS_URL = process.env.UMI_APP_WS_URL || 'ws://127.0.0.1:8000/ws/'; +export const EDITOR_URL = process.env.UMI_APP_EDITOR_URL || "https://editor-dev.isee4xai.com/"; -export const ONTOAPI_URL = process.env.NODE_ENV === 'production' - ? 'https://api-onto-dev.isee4xai.com/api' - : 'http://localhost:3100/api'; - -export const WS_URL = process.env.NODE_ENV === 'production' - ? 'wss://dialog-dev.isee4xai.com/ws/' - : 'ws://127.0.0.1:8000/ws/'; - -export const EDITOR_URL = "https://editor-dev.isee4xai.com/"; \ No newline at end of file