From 82d3f59d7827c43c8d50dcebd160fb90264a23f9 Mon Sep 17 00:00:00 2001 From: xnought Date: Tue, 9 Jan 2024 15:45:04 -0800 Subject: [PATCH] put the frontend outside of docker container --- docker-compose.yml | 28 ++++++++++++++-------------- frontend/src/lib/backend.ts | 3 ++- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2877a16e..0a7f5804 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,19 @@ # https://github.com/zeno-ml/zeno-hub/blob/main/docker-compose.yml version: "3" services: - frontend: - container_name: venome-frontend - build: - context: ./frontend - dockerfile: Dockerfile - volumes: - - ./frontend:/app - - docker_node_modules:/app/node_modules/ - ports: - - "5173:5173" - environment: - PUBLIC_BACKEND_URL: http://localhost:8000 - command: ["yarn", "dev", "--", "--host", "0.0.0.0"] + # frontend: + # container_name: venome-frontend + # build: + # context: ./frontend + # dockerfile: Dockerfile + # volumes: + # - ./frontend:/app + # - docker_node_modules:/app/node_modules/ + # ports: + # - "5173:5173" + # environment: + # PUBLIC_BACKEND_URL: http://localhost:8000 + # command: ["yarn", "dev", "--", "--host", "0.0.0.0"] backend: container_name: venome-backend build: @@ -55,5 +55,5 @@ services: volumes: postgres_data: - docker_node_modules: + # docker_node_modules: docker_venv: diff --git a/frontend/src/lib/backend.ts b/frontend/src/lib/backend.ts index 2146c417..20cc6743 100644 --- a/frontend/src/lib/backend.ts +++ b/frontend/src/lib/backend.ts @@ -3,6 +3,7 @@ export { DefaultService as Backend } from "../openapi"; import { OpenAPI } from "../openapi"; import { env } from "$env/dynamic/public"; -export const BACKEND_URL = env["PUBLIC_BACKEND_URL"]; +// export const BACKEND_URL = env["PUBLIC_BACKEND_URL"]; +export const BACKEND_URL = "http://localhost:8000"; if (!BACKEND_URL) throw new Error("PUBLIC_BACKEND_URL is not set in .env"); OpenAPI.BASE = BACKEND_URL;