Spaces:
Running
Running
Hermes Agent commited on
Commit ·
d262fc5
1
Parent(s): 8cd4896
fix: copy gateway directory in Dockerfile and insert BASE_DIR into sys.path to eliminate ModuleNotFoundError
Browse files- Dockerfile +2 -0
- proxy.py +8 -0
Dockerfile
CHANGED
|
@@ -53,6 +53,8 @@ COPY entrypoint.sh /entrypoint.sh
|
|
| 53 |
COPY nginx.conf /nginx.conf
|
| 54 |
COPY proxy.py /proxy.py
|
| 55 |
COPY tg_streamer.py /tg_streamer.py
|
|
|
|
|
|
|
| 56 |
RUN chmod +x /entrypoint.sh
|
| 57 |
|
| 58 |
WORKDIR /projects/default
|
|
|
|
| 53 |
COPY nginx.conf /nginx.conf
|
| 54 |
COPY proxy.py /proxy.py
|
| 55 |
COPY tg_streamer.py /tg_streamer.py
|
| 56 |
+
COPY gateway /gateway
|
| 57 |
+
COPY index.html /index.html
|
| 58 |
RUN chmod +x /entrypoint.sh
|
| 59 |
|
| 60 |
WORKDIR /projects/default
|
proxy.py
CHANGED
|
@@ -4,6 +4,14 @@ OpenCode Space Gateway Entrypoint
|
|
| 4 |
Imports the modular FastAPI application from the gateway package.
|
| 5 |
"""
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
from gateway import app
|
| 8 |
|
| 9 |
__all__ = ["app"]
|
|
|
|
| 4 |
Imports the modular FastAPI application from the gateway package.
|
| 5 |
"""
|
| 6 |
|
| 7 |
+
import sys
|
| 8 |
+
import os
|
| 9 |
+
|
| 10 |
+
# Ensure the directory containing proxy.py is in sys.path
|
| 11 |
+
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 12 |
+
if BASE_DIR not in sys.path:
|
| 13 |
+
sys.path.insert(0, BASE_DIR)
|
| 14 |
+
|
| 15 |
from gateway import app
|
| 16 |
|
| 17 |
__all__ = ["app"]
|