Skip to content

Commit 88a1cf9

Browse files
committed
Migrate to vite for development and building
1 parent ebf07e4 commit 88a1cf9

18 files changed

Lines changed: 2607 additions & 11325 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,5 +163,5 @@ cython_debug/
163163
node_modules
164164

165165

166-
static/*
166+
assets/*
167167
templates/*

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ FROM python:3.13 AS builder
22
WORKDIR /app
33
COPY service/ /app/service/
44
COPY templates/ /app/templates/
5-
COPY static/ /app/static/
5+
COPY assets/ /app/assets/
66
COPY requirements.txt /app/requirements.txt
77
RUN pip install --no-cache-dir --no-deps -r requirements.txt -t /app
88

99
FROM python:3.13-slim
1010
WORKDIR /app
1111
COPY --from=builder /app/ /app/
1212
EXPOSE 8000
13-
CMD ["python", "-m", "uvicorn", "service.main:app", "--host", "0.0.0.0", "--port", "8000"]
13+
CMD ["python", "-m", "uvicorn", "service.main:app", "--host", "0.0.0.0", "--port", "8000", "--log-level", "info"]
1414
LABEL org.opencontainers.image.source https://github.com/radaron/CDMServer

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ start-frontent:
3434
cd frontend && pnpm start
3535

3636
build-frontend:
37-
rm -rf static/* templates/*
37+
rm -rf assets/* templates/*
3838
cd frontend && pnpm build
39-
cp -r frontend/build/static/* static/
40-
cp frontend/build/favicon.png static/favicon.png
39+
cp -r frontend/build/assets/ assets/
4140
cp frontend/build/index.html templates/index.html
4241

4342
docker-compose: build-frontend

frontend/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v22.14.0
1+
v22.15.0
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
5+
<link rel="icon" href="favicon.png" />
66
<title>CDM</title>
77
</head>
88
<body>
99
<noscript>You need to enable JavaScript to run this app.</noscript>
1010
<div id="root"></div>
1111
</body>
12+
<script type='module' src='/src/main.jsx'></script>
1213
</html>

frontend/package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,21 @@
1414
"react-dom": "^19.1.0",
1515
"react-i18next": "^15.5.1",
1616
"react-router": "^7.6.0",
17-
"react-scripts": "^5.0.1",
18-
"sass": "^1.87.0",
1917
"web-vitals": "^4.2.4"
2018
},
2119
"devDependencies": {
22-
"standard": "^17.1.2"
20+
"@vitejs/plugin-react": "^4.4.1",
21+
"standard": "^17.1.2",
22+
"typescript": "^5.8.3",
23+
"vite": "^6.3.5"
2324
},
2425
"scripts": {
25-
"start": "react-scripts start",
26-
"build": "react-scripts build",
26+
"start": "vite",
27+
"build": "vite build",
2728
"test": "react-scripts test",
28-
"eject": "react-scripts eject",
2929
"lint": "standard src/",
3030
"lint:fix": "standard src/ --fix"
3131
},
32-
"proxy": "http://localhost:8000",
3332
"eslintConfig": {
3433
"extends": [
3534
"react-app",

0 commit comments

Comments
 (0)