Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,16 @@ async def get_vector_preview(
logger.error(f"Error getting vector preview for {dataset_name}.{column}: {e}")
raise HTTPException(status_code=500, detail="Failed to get vector preview")

# Only mount static files if the directory exists (for production)
if os.path.exists("/web"):
app.mount("/", StaticFiles(directory="/web", html=True), name="static")
# Mount static files - use vanilla version by default
# In production, Docker copies vanilla files to /web
# For local development, serve from web/vanilla
static_dir = "/web"
if not os.path.exists(static_dir):
# Local development - serve vanilla version
static_dir = os.path.join(os.path.dirname(__file__), "..", "web", "vanilla")

if os.path.exists(static_dir):
app.mount("/", StaticFiles(directory=static_dir, html=True), name="static")

if __name__ == "__main__":
import uvicorn
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ COPY --from=builder /root/.local /home/appuser/.local
WORKDIR /app

COPY backend/app.py .
COPY web/ /web/
COPY web/vanilla/ /web/

RUN chown -R appuser:appuser /app /web
RUN chmod -R 755 /web
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.