Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务器上部署发现问题 #63

Open
code-lixm opened this issue Jul 2, 2024 · 4 comments
Open

服务器上部署发现问题 #63

code-lixm opened this issue Jul 2, 2024 · 4 comments

Comments

@code-lixm
Copy link

code-lixm commented Jul 2, 2024

我现在将三个端口统一从一个域名下转发,如下
image

现在发现一个奇怪的现象:
每次普通刷新:
image
控制台打印的变量都不是设置的变量
image

然后强制刷新再打印
image
但是config.ts访问还是访问不到,导致走默认firebase的逻辑,请有时间看一下

@ajf12f
Copy link

ajf12f commented Nov 15, 2024

清理缓存,或者换个浏览器再测

@majunze2001
Copy link

On Ubuntu 22.04.5 with Docker version 27.4.1, the environment variables weren't passed in the frontend. Modifying the docker-compose file and the frontend Dockerfile worked.

@alswl
Copy link
Owner

alswl commented Jan 15, 2025

@majunze2001 Can you show me the patch code?

@majunze2001
Copy link

Sure. Modifications to the frontend in the docker-compose.yaml:

  frontend:
    build:
      context: ./excalidraw
      args:
        VITE_APP_BACKEND_V2_GET_URL: "https://example.com:8081/api/v2/scenes/"
        VITE_APP_BACKEND_V2_POST_URL: "https://example.com:8081/api/v2/scenes/"
        VITE_APP_WS_SERVER_URL: "https://example.com:8082"
        VITE_APP_FIREBASE_CONFIG: "{}"
        # alswl'fork env
        # forked excalidraw can use env https://github.com/excalidraw/pull/5
        VITE_APP_HTTP_STORAGE_BACKEND_URL: "https://example.com:8081/api/v2"
        VITE_APP_STORAGE_BACKEND: "http"
        PUBLIC_URL: "https://example.com"

The excalidraw directory is cloned from your repo, with the following lines added to the Dockerfile after the base image.

ARG VITE_APP_BACKEND_V2_GET_URL
ARG VITE_APP_BACKEND_V2_POST_URL
ARG VITE_APP_WS_SERVER_URL
ARG VITE_APP_FIREBASE_CONFIG
ARG VITE_APP_HTTP_STORAGE_BACKEND_URL
ARG VITE_APP_STORAGE_BACKEND
ARG PUBLIC_URL

I am not sure if this is because I'm using arm machines, but anyway, I need to build the images manually.
The room and storage backend worked out of the box for me. Thank you for the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants