mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-11-30 22:45:46 +01:00
Compare commits
12 Commits
09e08ff615
...
v0.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b699b05d3 | |||
| dcac0307a2 | |||
| a0cc859935 | |||
| 49afd75ed3 | |||
| ebb9e3f4fe | |||
| 48f140f930 | |||
| b6b31659e3 | |||
| 42e343777a | |||
| aa7af272d8 | |||
| a0d96925c5 | |||
|
|
28283fa8bc | ||
|
|
fdff2853bd |
17
.github/workflows/docker.yml
vendored
17
.github/workflows/docker.yml
vendored
@@ -1,10 +1,10 @@
|
||||
name: CI/CD Pipeline
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ main, master, development ]
|
||||
pull_request:
|
||||
branches: [ main, master, development ]
|
||||
branches: [ "development", "main", "staging" ]
|
||||
tags: [ "v*.*.*" ]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
@@ -110,8 +110,9 @@ jobs:
|
||||
if: github.event_name == 'push'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
packages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
@@ -163,7 +164,7 @@ jobs:
|
||||
|
||||
- name: Display pushed images
|
||||
run: |
|
||||
echo "✅ Docker images pushed successfully!"
|
||||
echo "📦 Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
|
||||
echo "🏷️ Tags: ${{ steps.meta.outputs.tags }}"
|
||||
echo "🚀 New version: ${{ needs.set-tag.outputs.tag_name }}"
|
||||
echo "Docker images pushed successfully!"
|
||||
echo "- Image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}"
|
||||
echo "- Tags: ${{ steps.meta.outputs.tags }}"
|
||||
echo "- New version: ${{ needs.set-tag.outputs.tag_name }}"
|
||||
|
||||
25
Dockerfile
25
Dockerfile
@@ -5,7 +5,7 @@ WORKDIR /app/backend
|
||||
|
||||
# Install Python + OR-Tools
|
||||
RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
||||
&& pip install --no-cache-dir ortools
|
||||
&& pip install --no-cache-dir ortools
|
||||
|
||||
# Create symlink so python3 is callable as python
|
||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||
@@ -23,13 +23,9 @@ COPY backend/src/ ./src/
|
||||
# Build backend
|
||||
RUN npm run build
|
||||
|
||||
|
||||
# Verify Python and OR-Tools installation
|
||||
RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
|
||||
|
||||
#RUN python3 -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
|
||||
|
||||
|
||||
# Frontend build stage
|
||||
FROM node:20-bullseye AS frontend-builder
|
||||
|
||||
@@ -54,12 +50,6 @@ FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install Python and OR-Tools for production
|
||||
#RUN apk add --no-cache \
|
||||
# python \
|
||||
# py3-pip \
|
||||
# && pip3 install ortools
|
||||
|
||||
# Install PM2 for process management
|
||||
RUN npm install -g pm2
|
||||
|
||||
@@ -67,28 +57,23 @@ RUN npm install -g pm2
|
||||
COPY --from=backend-builder /app/backend/package*.json ./
|
||||
COPY --from=backend-builder /app/backend/dist/ ./dist/
|
||||
COPY --from=backend-builder /app/backend/node_modules/ ./node_modules/
|
||||
# COPY --from=backend-builder /app/backend/python-scripts/ ./python-scripts/
|
||||
|
||||
# Copy frontend built files
|
||||
COPY --from=frontend-builder /app/frontend/build/ ./frontend-build/
|
||||
|
||||
# Copy PM2 configuration
|
||||
COPY ecosystem.config.js ./
|
||||
COPY ecosystem.config.cjs ./
|
||||
|
||||
# Create a non-root user
|
||||
RUN addgroup -g 1001 -S nodejs && \
|
||||
adduser -S schichtplan -u 1001 && \
|
||||
chown -R schichtplan:nodejs /app
|
||||
adduser -S schichtplan -u 1001 && \
|
||||
chown -R schichtplan:nodejs /app
|
||||
|
||||
USER schichtplan
|
||||
|
||||
# Verify installations
|
||||
#RUN python --version && \
|
||||
# python -c "from ortools.sat.python import cp_model; print('OR-Tools verified')"
|
||||
|
||||
EXPOSE 3000 3002
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3002/api/health || exit 1
|
||||
|
||||
CMD ["pm2-runtime", "ecosystem.config.js"]
|
||||
CMD ["pm2-runtime", "ecosystem.config.cjs"]
|
||||
@@ -1,3 +1,4 @@
|
||||
// ecosystem.config.cjs
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
Reference in New Issue
Block a user