mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 06:55:45 +01:00
Compare commits
8 Commits
23acd88ced
...
v0.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a1509d807 | |||
| e876f5eb02 | |||
| dabd2dff3b | |||
| 84d7be052d | |||
| 9460f10278 | |||
| 6e1927fe2f | |||
| e5a6fc73fe | |||
| c773740634 |
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@@ -78,9 +78,7 @@ jobs:
|
||||
|
||||
- name: Install backend dependencies
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
# Try npm ci first, if it fails use npm install
|
||||
npm ci || (echo "package-lock.json out of sync, using npm install..." && npm install)
|
||||
run: npm install
|
||||
|
||||
- name: Run TypeScript check
|
||||
working-directory: ./backend
|
||||
|
||||
40
Dockerfile
40
Dockerfile
@@ -10,13 +10,23 @@ RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
||||
# Create symlink so python3 is callable as python
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
|
||||
# Copy all files
|
||||
COPY . .
|
||||
# Copy root package files first
|
||||
COPY package*.json ./
|
||||
COPY tsconfig.base.json ./
|
||||
COPY ecosystem.config.cjs ./
|
||||
|
||||
# Install all dependencies (workspaces)
|
||||
RUN npm ci
|
||||
# Install root dependencies
|
||||
RUN npm install
|
||||
|
||||
# Build backend
|
||||
# Copy workspace files
|
||||
COPY backend/ ./backend/
|
||||
COPY frontend/ ./frontend/
|
||||
|
||||
# Install workspace dependencies individually
|
||||
RUN npm install --workspace=backend
|
||||
RUN npm install --workspace=frontend
|
||||
|
||||
# Build backend first
|
||||
RUN npm run build --workspace=backend
|
||||
|
||||
# Build frontend
|
||||
@@ -25,42 +35,30 @@ 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')"
|
||||
|
||||
# Production stage
|
||||
# Production stage (same as above)
|
||||
FROM node:20-bookworm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install PM2 for process management
|
||||
RUN npm install -g pm2
|
||||
|
||||
# Create data directory for SQLite database with proper permissions
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Copy backend built files
|
||||
COPY --from=builder /app/backend/dist/ ./dist/
|
||||
COPY --from=builder /app/backend/package*.json ./
|
||||
|
||||
# Copy only production dependencies
|
||||
COPY --from=builder /app/node_modules/ ./node_modules/
|
||||
|
||||
# Copy frontend built files
|
||||
COPY --from=builder /app/frontend/dist/ ./frontend-build/
|
||||
|
||||
# Copy PM2 configuration
|
||||
COPY --from=builder /app/ecosystem.config.cjs ./
|
||||
|
||||
# Create a non-root user and group - DEBIAN STYLE
|
||||
COPY --from=builder /app/backend/src/database/ ./dist/database/
|
||||
COPY --from=builder /app/backend/src/database/ ./database/
|
||||
|
||||
RUN groupadd -g 1001 nodejs && \
|
||||
useradd -m -u 1001 -s /bin/bash -g nodejs schichtplan && \
|
||||
chown -R schichtplan:nodejs /app && \
|
||||
chmod 755 /app && \
|
||||
chmod 775 /app/data
|
||||
|
||||
# Set PM2 to use app directory instead of home directory
|
||||
ENV PM2_HOME=/app/.pm2
|
||||
|
||||
USER schichtplan
|
||||
|
||||
EXPOSE 3002
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"react-router-dom": "^6.28.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "20.19.23",
|
||||
"@types/react": "^19.0.0",
|
||||
"@types/react-dom": "^19.0.0",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
|
||||
@@ -129,7 +129,7 @@ const Login: React.FC = () => {
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
required
|
||||
style={{
|
||||
width: '94.5%',
|
||||
width: '100%',
|
||||
padding: '10px',
|
||||
border: '1px solid #ddd',
|
||||
borderRadius: '4px',
|
||||
@@ -151,7 +151,7 @@ const Login: React.FC = () => {
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
required
|
||||
style={{
|
||||
width: '94.5%',
|
||||
width: '100%',
|
||||
padding: '10px',
|
||||
paddingRight: '10px',
|
||||
border: '1px solid #ddd',
|
||||
|
||||
2780
package-lock.json
generated
2780
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
2
premium
2
premium
Submodule premium updated: ce4b3fd6e0...c65016aaab
Reference in New Issue
Block a user