Spaces:
Running
Running
Commit Β·
7b67454
1
Parent(s): 29c6776
Refactor file structure
Browse files- Dockerfile +5 -5
- {frontend β frontends/react}/.gitignore +0 -0
- {frontend β frontends/react}/.prettierrc +0 -0
- {frontend β frontends/react}/.vite/deps/_metadata.json +0 -0
- {frontend β frontends/react}/.vite/deps/package.json +0 -0
- {frontend β frontends/react}/README.md +0 -0
- {frontend β frontends/react}/env.d.ts +0 -0
- {frontend β frontends/react}/eslint.config.js +0 -0
- {frontend β frontends/react}/index.html +0 -0
- {frontend β frontends/react}/package-lock.json +0 -0
- {frontend β frontends/react}/package.json +0 -0
- {frontend β frontends/react}/public/vite.svg +0 -0
- {frontend β frontends/react}/src/App.tsx +0 -0
- {frontend β frontends/react}/src/OptimizationPlot.tsx +0 -0
- {frontend β frontends/react}/src/Sidebar.tsx +0 -0
- {frontend β frontends/react}/src/assets/react.svg +0 -0
- {frontend β frontends/react}/src/index.css +0 -0
- {frontend β frontends/react}/src/main.tsx +0 -0
- {frontend β frontends/react}/src/pyodide.worker.ts +2 -2
- {frontend β frontends/react}/src/types.ts +0 -0
- {frontend β frontends/react}/src/ui/Button.tsx +0 -0
- {frontend β frontends/react}/src/ui/Dropdown.tsx +0 -0
- {frontend β frontends/react}/src/ui/InputField.tsx +0 -0
- {frontend β frontends/react}/src/ui/LoadingScreen.tsx +0 -0
- {frontend β frontends/react}/src/ui/Radio.tsx +0 -0
- {frontend β frontends/react}/src/ui/Tabs.tsx +0 -0
- {frontend β frontends/react}/src/useApi.ts +0 -0
- {frontend β frontends/react}/src/usePyodide.ts +0 -0
- {frontend β frontends/react}/src/websocket.ts +0 -0
- {frontend β frontends/react}/tsconfig.app.json +0 -0
- {frontend β frontends/react}/tsconfig.json +0 -0
- {frontend β frontends/react}/tsconfig.node.json +0 -0
- {frontend β frontends/react}/vite.config.ts +0 -0
Dockerfile
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
# Step 1: Build your app
|
| 2 |
FROM node:20 AS builder
|
| 3 |
WORKDIR /app
|
| 4 |
-
COPY
|
| 5 |
-
RUN cd
|
| 6 |
COPY . .
|
| 7 |
-
RUN cd
|
| 8 |
|
| 9 |
# Step 2: Serve it with npx
|
| 10 |
FROM node:20-slim
|
| 11 |
WORKDIR /app
|
| 12 |
# Only copy the built files from the builder
|
| 13 |
-
COPY --from=builder /app/
|
| 14 |
|
| 15 |
# Install the server tool
|
| 16 |
RUN npm install -g serve
|
| 17 |
|
| 18 |
# Serve the 'dist' folder on the correct Hugging Face port
|
| 19 |
# -s flag handles Single Page App routing (important for React)
|
| 20 |
-
CMD ["serve", "-s", "dist", "-l", "7860"]
|
|
|
|
| 1 |
# Step 1: Build your app
|
| 2 |
FROM node:20 AS builder
|
| 3 |
WORKDIR /app
|
| 4 |
+
COPY frontends/react/package*.json ./frontends/react/
|
| 5 |
+
RUN cd frontends/react && npm install
|
| 6 |
COPY . .
|
| 7 |
+
RUN cd frontends/react && npm run build
|
| 8 |
|
| 9 |
# Step 2: Serve it with npx
|
| 10 |
FROM node:20-slim
|
| 11 |
WORKDIR /app
|
| 12 |
# Only copy the built files from the builder
|
| 13 |
+
COPY --from=builder /app/frontends/react/dist ./dist
|
| 14 |
|
| 15 |
# Install the server tool
|
| 16 |
RUN npm install -g serve
|
| 17 |
|
| 18 |
# Serve the 'dist' folder on the correct Hugging Face port
|
| 19 |
# -s flag handles Single Page App routing (important for React)
|
| 20 |
+
CMD ["serve", "-s", "dist", "-l", "7860"]
|
{frontend β frontends/react}/.gitignore
RENAMED
|
File without changes
|
{frontend β frontends/react}/.prettierrc
RENAMED
|
File without changes
|
{frontend β frontends/react}/.vite/deps/_metadata.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/.vite/deps/package.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/README.md
RENAMED
|
File without changes
|
{frontend β frontends/react}/env.d.ts
RENAMED
|
File without changes
|
{frontend β frontends/react}/eslint.config.js
RENAMED
|
File without changes
|
{frontend β frontends/react}/index.html
RENAMED
|
File without changes
|
{frontend β frontends/react}/package-lock.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/package.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/public/vite.svg
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/App.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/OptimizationPlot.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/Sidebar.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/assets/react.svg
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/index.css
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/main.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/pyodide.worker.ts
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
const PYODIDE_URL = "https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs";
|
| 2 |
|
| 3 |
// @ts-ignore
|
| 4 |
-
import managerCode from "../../backend/src/optimization_manager.py?raw";
|
| 5 |
-
import logicCode from "../../backend/src/optimization_logic.py?raw";
|
| 6 |
import type { WorkerMessage } from "./types";
|
| 7 |
|
| 8 |
let pyodide: any = null;
|
|
|
|
| 1 |
const PYODIDE_URL = "https://cdn.jsdelivr.net/pyodide/v0.26.1/full/pyodide.mjs";
|
| 2 |
|
| 3 |
// @ts-ignore
|
| 4 |
+
import managerCode from "../../../backend/src/optimization_manager.py?raw";
|
| 5 |
+
import logicCode from "../../../backend/src/optimization_logic.py?raw";
|
| 6 |
import type { WorkerMessage } from "./types";
|
| 7 |
|
| 8 |
let pyodide: any = null;
|
{frontend β frontends/react}/src/types.ts
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/ui/Button.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/ui/Dropdown.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/ui/InputField.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/ui/LoadingScreen.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/ui/Radio.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/ui/Tabs.tsx
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/useApi.ts
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/usePyodide.ts
RENAMED
|
File without changes
|
{frontend β frontends/react}/src/websocket.ts
RENAMED
|
File without changes
|
{frontend β frontends/react}/tsconfig.app.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/tsconfig.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/tsconfig.node.json
RENAMED
|
File without changes
|
{frontend β frontends/react}/vite.config.ts
RENAMED
|
File without changes
|