Skip to content

Commit

Permalink
put the frontend outside of docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought committed Jan 9, 2024
1 parent f938fbd commit 82d3f59
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
28 changes: 14 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -55,5 +55,5 @@ services:

volumes:
postgres_data:
docker_node_modules:
# docker_node_modules:
docker_venv:
3 changes: 2 additions & 1 deletion frontend/src/lib/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 82d3f59

Please sign in to comment.