mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
Compare commits
11 Commits
da2b3b0126
...
v1.0.17
| Author | SHA1 | Date | |
|---|---|---|---|
| 7c63bee1b3 | |||
| 4c275993e6 | |||
| 5c925e3b54 | |||
| 11b6ee7672 | |||
| 19357d12c1 | |||
| 8ccd506b7d | |||
| e09979aa77 | |||
| 0eda1ac125 | |||
| 6aa9511fbe | |||
| ab24f5cf35 | |||
| 2e81ed48c4 |
6
.github/workflows/docker.yml
vendored
6
.github/workflows/docker.yml
vendored
@@ -83,9 +83,13 @@ jobs:
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Create package-lock.json
|
||||
working-directory: .
|
||||
run: npm i --package-lock-only
|
||||
|
||||
- name: Install backend dependencies
|
||||
working-directory: ./backend
|
||||
run: npm install
|
||||
run: npm ci
|
||||
|
||||
- name: Run TypeScript check
|
||||
working-directory: ./backend
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -57,6 +57,7 @@ yarn-error.log*
|
||||
# Build outputs
|
||||
dist/
|
||||
build/
|
||||
package-lock.json
|
||||
|
||||
# Environment variables
|
||||
.env
|
||||
|
||||
33
Dockerfile
33
Dockerfile
@@ -1,22 +1,17 @@
|
||||
# Single stage build for workspaces
|
||||
FROM node:20-bullseye AS builder
|
||||
FROM node:20-bookworm AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Python + OR-Tools
|
||||
RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
||||
&& pip install --no-cache-dir ortools
|
||||
|
||||
# Create symlink so python3 is callable as python
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
# Copy root package files first
|
||||
COPY package*.json ./
|
||||
COPY tsconfig.base.json ./
|
||||
COPY ecosystem.config.cjs ./
|
||||
|
||||
# Install root dependencies
|
||||
RUN npm install --only=production
|
||||
#RUN npm install --only=production
|
||||
RUN npm i --package-lock-only
|
||||
RUN npm ci
|
||||
|
||||
# Copy workspace files
|
||||
COPY backend/ ./backend/
|
||||
@@ -30,10 +25,7 @@ RUN npm install --workspace=frontend
|
||||
RUN npm run build --only=production --workspace=backend
|
||||
|
||||
# Build frontend
|
||||
RUN npm run build --workspace=frontend
|
||||
|
||||
# Verify Python and OR-Tools installation
|
||||
RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
|
||||
RUN npm run build --only=production --workspace=frontend
|
||||
|
||||
# Production stage
|
||||
FROM node:20-bookworm
|
||||
@@ -57,7 +49,20 @@ COPY --from=builder /app/frontend/dist/ ./frontend-build/
|
||||
COPY --from=builder /app/ecosystem.config.cjs ./
|
||||
|
||||
COPY --from=builder /app/backend/src/database/ ./dist/database/
|
||||
COPY --from=builder /app/backend/src/database/ ./database/
|
||||
# should be obsolete with the line above
|
||||
#COPY --from=builder /app/backend/src/database/ ./database/
|
||||
|
||||
COPY --from=builder /app/backend/src/python-scripts/ ./python-scripts/
|
||||
|
||||
# Install Python + OR-Tools
|
||||
RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
||||
&& pip install --no-cache-dir --break-system-packages ortools
|
||||
|
||||
# Create symlink so python3 is callable as python
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
# Verify Python and OR-Tools installation
|
||||
RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
|
||||
|
||||
# Copy init script and env template
|
||||
COPY docker-init.sh /usr/local/bin/
|
||||
|
||||
@@ -72,8 +72,8 @@ const getRateLimitConfig = () => {
|
||||
return {
|
||||
windowMs: parseInt(process.env.RATE_LIMIT_WINDOW_MS || '900000'), // 15 minutes default
|
||||
max: isProduction
|
||||
? parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '100') // Stricter in production
|
||||
: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '1000'), // More lenient in development
|
||||
? parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '1000') // Stricter in production
|
||||
: parseInt(process.env.RATE_LIMIT_MAX_REQUESTS || '5000'), // More lenient in development
|
||||
|
||||
// Development-specific relaxations
|
||||
skip: (req: Request) => {
|
||||
@@ -112,7 +112,7 @@ export const apiLimiter = rateLimit({
|
||||
// Strict limiter for auth endpoints
|
||||
export const authLimiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000,
|
||||
max: parseInt(process.env.AUTH_RATE_LIMIT_MAX_REQUESTS || '5'),
|
||||
max: parseInt(process.env.AUTH_RATE_LIMIT_MAX_REQUESTS || '100'),
|
||||
message: {
|
||||
error: 'Zu viele Login-Versuche, bitte versuchen Sie es später erneut'
|
||||
},
|
||||
@@ -135,7 +135,7 @@ export const authLimiter = rateLimit({
|
||||
// Separate limiter for expensive endpoints
|
||||
export const expensiveEndpointLimiter = rateLimit({
|
||||
windowMs: 15 * 60 * 1000,
|
||||
max: parseInt(process.env.EXPENSIVE_ENDPOINT_LIMIT || '10'),
|
||||
max: parseInt(process.env.EXPENSIVE_ENDPOINT_LIMIT || '100'),
|
||||
message: {
|
||||
error: 'Zu viele Anfragen für diese Ressource'
|
||||
},
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^6.28.0",
|
||||
"date-fns": "4.1.0"
|
||||
"date-fns": "4.1.0",
|
||||
"@vitejs/plugin-react": "^4.3.3",
|
||||
"vite": "^6.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.19.23",
|
||||
|
||||
5511
package-lock.json
generated
5511
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user