mirror of
https://github.com/donpat1to/Schichtenplaner.git
synced 2025-12-01 15:05:45 +01:00
Compare commits
4 Commits
28283fa8bc
...
b6b31659e3
| Author | SHA1 | Date | |
|---|---|---|---|
| b6b31659e3 | |||
| 42e343777a | |||
| aa7af272d8 | |||
| a0d96925c5 |
1
.github/workflows/docker.yml
vendored
1
.github/workflows/docker.yml
vendored
@@ -113,6 +113,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
packages: write
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
|
|||||||
13
Dockerfile
13
Dockerfile
@@ -5,7 +5,7 @@ WORKDIR /app/backend
|
|||||||
|
|
||||||
# Install Python + OR-Tools
|
# Install Python + OR-Tools
|
||||||
RUN apt-get update && apt-get install -y python3 python3-pip build-essential \
|
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
|
# Create symlink so python3 is callable as python
|
||||||
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
RUN ln -sf /usr/bin/python3 /usr/bin/python
|
||||||
@@ -27,9 +27,6 @@ RUN npm run build
|
|||||||
# Verify Python and OR-Tools installation
|
# Verify Python and OR-Tools installation
|
||||||
RUN python -c "from ortools.sat.python import cp_model; print('OR-Tools installed successfully')"
|
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
|
# Frontend build stage
|
||||||
FROM node:20-bullseye AS frontend-builder
|
FROM node:20-bullseye AS frontend-builder
|
||||||
|
|
||||||
@@ -73,12 +70,12 @@ COPY --from=backend-builder /app/backend/node_modules/ ./node_modules/
|
|||||||
COPY --from=frontend-builder /app/frontend/build/ ./frontend-build/
|
COPY --from=frontend-builder /app/frontend/build/ ./frontend-build/
|
||||||
|
|
||||||
# Copy PM2 configuration
|
# Copy PM2 configuration
|
||||||
COPY ecosystem.config.js ./
|
COPY ecosystem.config.cjs ./
|
||||||
|
|
||||||
# Create a non-root user
|
# Create a non-root user
|
||||||
RUN addgroup -g 1001 -S nodejs && \
|
RUN addgroup -g 1001 -S nodejs && \
|
||||||
adduser -S schichtplan -u 1001 && \
|
adduser -S schichtplan -u 1001 && \
|
||||||
chown -R schichtplan:nodejs /app
|
chown -R schichtplan:nodejs /app
|
||||||
|
|
||||||
USER schichtplan
|
USER schichtplan
|
||||||
|
|
||||||
@@ -91,4 +88,4 @@ EXPOSE 3000 3002
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
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 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 = {
|
module.exports = {
|
||||||
apps: [
|
apps: [
|
||||||
{
|
{
|
||||||
Reference in New Issue
Block a user