@turboops/cli 1.0.0-dev.613 → 1.0.0-dev.614
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +108 -32
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2116,16 +2116,24 @@ volumes:
|
|
|
2116
2116
|
\`\`\`
|
|
2117
2117
|
|
|
2118
2118
|
2. Dockerfile f\xFCr jeden Service (im jeweiligen Ordner)
|
|
2119
|
+
KRITISCH: IMMER --ignore-scripts bei npm ci verwenden!
|
|
2119
2120
|
\`\`\`dockerfile
|
|
2120
|
-
#
|
|
2121
|
-
FROM node:
|
|
2121
|
+
# Stage 1: Dependencies
|
|
2122
|
+
FROM node:22-alpine AS deps
|
|
2122
2123
|
WORKDIR /app
|
|
2123
2124
|
COPY package*.json ./
|
|
2124
|
-
|
|
2125
|
+
# KRITISCH: --ignore-scripts verhindert husky/prepare Fehler in Docker!
|
|
2126
|
+
RUN npm ci --ignore-scripts
|
|
2127
|
+
|
|
2128
|
+
# Stage 2: Builder
|
|
2129
|
+
FROM node:22-alpine AS builder
|
|
2130
|
+
WORKDIR /app
|
|
2131
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
2125
2132
|
COPY . .
|
|
2126
2133
|
RUN npm run build
|
|
2127
2134
|
|
|
2128
|
-
|
|
2135
|
+
# Stage 3: Runner (Production)
|
|
2136
|
+
FROM node:22-alpine AS runner
|
|
2129
2137
|
WORKDIR /app
|
|
2130
2138
|
ENV NODE_ENV=production
|
|
2131
2139
|
# Non-root user f\xFCr Sicherheit
|
|
@@ -2151,6 +2159,7 @@ coverage
|
|
|
2151
2159
|
\`\`\`
|
|
2152
2160
|
|
|
2153
2161
|
=== WICHTIGE REGELN ===
|
|
2162
|
+
- KRITISCH: IMMER \`npm ci --ignore-scripts\` verwenden (verhindert husky/prepare Fehler!)
|
|
2154
2163
|
- Pr\xFCfe die tats\xE4chliche Projektstruktur (projects/, packages/, apps/, oder flach)
|
|
2155
2164
|
- Passe Pfade entsprechend an
|
|
2156
2165
|
- NestJS: CMD ["node", "dist/main.js"]
|
|
@@ -2625,23 +2634,55 @@ async function createDockerSetupWithAI2() {
|
|
|
2625
2634
|
|
|
2626
2635
|
**Wichtig: TurboOps ben\xF6tigt eine docker-compose.yml auf Root-Ebene!**
|
|
2627
2636
|
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2637
|
+
KRITISCHE ANFORDERUNGEN:
|
|
2638
|
+
|
|
2639
|
+
1. docker-compose.yml im Projekt-Root:
|
|
2640
|
+
- Services f\xFCr alle Komponenten (api, app, etc.)
|
|
2631
2641
|
- Verwende build-Direktive mit Pfad zu den Dockerfiles
|
|
2642
|
+
- KEINE version: Angabe (deprecated)
|
|
2632
2643
|
- Health-Checks f\xFCr alle Services
|
|
2633
|
-
- Production-geeignete Konfiguration
|
|
2634
2644
|
|
|
2635
|
-
2.
|
|
2636
|
-
- Multi-stage builds
|
|
2637
|
-
-
|
|
2638
|
-
-
|
|
2645
|
+
2. Dockerfiles - WICHTIGE REGELN:
|
|
2646
|
+
- Multi-stage builds (deps -> builder -> runner)
|
|
2647
|
+
- IMMER \`npm ci --ignore-scripts\` verwenden (verhindert husky/prepare Fehler!)
|
|
2648
|
+
- Non-root User f\xFCr Production
|
|
2649
|
+
- Minimales Base-Image (node:22-alpine)
|
|
2639
2650
|
|
|
2640
|
-
3.
|
|
2641
|
-
- node_modules, .git,
|
|
2651
|
+
3. .dockerignore auf Root-Ebene:
|
|
2652
|
+
- node_modules, .git, dist, .env*, *.log
|
|
2653
|
+
|
|
2654
|
+
4. Monorepo-Struktur beachten:
|
|
2655
|
+
- Pr\xFCfe projects/, packages/, apps/ Ordner
|
|
2656
|
+
- Context muss Root sein f\xFCr Monorepo-Zugriff
|
|
2657
|
+
|
|
2658
|
+
DOCKERFILE-TEMPLATE (STRIKT EINHALTEN!):
|
|
2659
|
+
\`\`\`dockerfile
|
|
2660
|
+
# Stage 1: Dependencies
|
|
2661
|
+
FROM node:22-alpine AS deps
|
|
2662
|
+
WORKDIR /app
|
|
2663
|
+
COPY package*.json ./
|
|
2664
|
+
# WICHTIG: --ignore-scripts verhindert husky/prepare Fehler!
|
|
2665
|
+
RUN npm ci --ignore-scripts
|
|
2642
2666
|
|
|
2643
|
-
|
|
2644
|
-
|
|
2667
|
+
# Stage 2: Builder
|
|
2668
|
+
FROM node:22-alpine AS builder
|
|
2669
|
+
WORKDIR /app
|
|
2670
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
2671
|
+
COPY . .
|
|
2672
|
+
RUN npm run build
|
|
2673
|
+
|
|
2674
|
+
# Stage 3: Runner (Production)
|
|
2675
|
+
FROM node:22-alpine AS runner
|
|
2676
|
+
WORKDIR /app
|
|
2677
|
+
ENV NODE_ENV=production
|
|
2678
|
+
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
|
|
2679
|
+
USER nodejs
|
|
2680
|
+
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
|
|
2681
|
+
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
|
|
2682
|
+
COPY --from=builder --chown=nodejs:nodejs /app/package.json ./
|
|
2683
|
+
EXPOSE 3000
|
|
2684
|
+
CMD ["node", "dist/main.js"]
|
|
2685
|
+
\`\`\`
|
|
2645
2686
|
|
|
2646
2687
|
Erstelle alle notwendigen Dateien.`;
|
|
2647
2688
|
const success = await aiToolsService.runWithPrompt(tool, prompt);
|
|
@@ -2711,36 +2752,71 @@ var DOCKER_SETUP_PROMPT = `Analysiere dieses Projekt und erstelle ein vollst\xE4
|
|
|
2711
2752
|
|
|
2712
2753
|
**Wichtig: TurboOps ben\xF6tigt eine docker-compose.yml auf Root-Ebene!**
|
|
2713
2754
|
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2755
|
+
KRITISCHE ANFORDERUNGEN:
|
|
2756
|
+
|
|
2757
|
+
1. docker-compose.yml im Projekt-Root:
|
|
2758
|
+
- Services f\xFCr alle Komponenten (api, app, etc.)
|
|
2717
2759
|
- Verwende build-Direktive mit Pfad zu den Dockerfiles
|
|
2760
|
+
- KEINE version: Angabe (deprecated)
|
|
2718
2761
|
- Health-Checks f\xFCr alle Services
|
|
2719
|
-
- Production-geeignete Konfiguration
|
|
2720
2762
|
|
|
2721
|
-
2.
|
|
2722
|
-
- Multi-stage builds
|
|
2723
|
-
-
|
|
2724
|
-
-
|
|
2763
|
+
2. Dockerfiles - WICHTIGE REGELN:
|
|
2764
|
+
- Multi-stage builds (deps -> builder -> runner)
|
|
2765
|
+
- IMMER \`npm ci --ignore-scripts\` verwenden (verhindert husky/prepare Fehler!)
|
|
2766
|
+
- Non-root User f\xFCr Production
|
|
2767
|
+
- Minimales Base-Image (node:22-alpine)
|
|
2725
2768
|
|
|
2726
|
-
3.
|
|
2727
|
-
- node_modules, .git,
|
|
2769
|
+
3. .dockerignore auf Root-Ebene:
|
|
2770
|
+
- node_modules, .git, dist, .env*, *.log
|
|
2728
2771
|
|
|
2729
|
-
4.
|
|
2730
|
-
- Pr\xFCfe
|
|
2772
|
+
4. Monorepo-Struktur beachten:
|
|
2773
|
+
- Pr\xFCfe projects/, packages/, apps/ Ordner
|
|
2774
|
+
- Context muss Root sein f\xFCr Monorepo-Zugriff
|
|
2731
2775
|
|
|
2732
|
-
|
|
2776
|
+
DOCKERFILE-TEMPLATE (STRIKT EINHALTEN!):
|
|
2777
|
+
\`\`\`dockerfile
|
|
2778
|
+
# Stage 1: Dependencies
|
|
2779
|
+
FROM node:22-alpine AS deps
|
|
2780
|
+
WORKDIR /app
|
|
2781
|
+
COPY package*.json ./
|
|
2782
|
+
# WICHTIG: --ignore-scripts verhindert husky/prepare Fehler!
|
|
2783
|
+
RUN npm ci --ignore-scripts
|
|
2784
|
+
|
|
2785
|
+
# Stage 2: Builder
|
|
2786
|
+
FROM node:22-alpine AS builder
|
|
2787
|
+
WORKDIR /app
|
|
2788
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
2789
|
+
COPY . .
|
|
2790
|
+
RUN npm run build
|
|
2791
|
+
|
|
2792
|
+
# Stage 3: Runner (Production)
|
|
2793
|
+
FROM node:22-alpine AS runner
|
|
2794
|
+
WORKDIR /app
|
|
2795
|
+
ENV NODE_ENV=production
|
|
2796
|
+
|
|
2797
|
+
# Non-root user
|
|
2798
|
+
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
|
|
2799
|
+
USER nodejs
|
|
2800
|
+
|
|
2801
|
+
COPY --from=builder --chown=nodejs:nodejs /app/dist ./dist
|
|
2802
|
+
COPY --from=builder --chown=nodejs:nodejs /app/node_modules ./node_modules
|
|
2803
|
+
COPY --from=builder --chown=nodejs:nodejs /app/package.json ./
|
|
2804
|
+
|
|
2805
|
+
EXPOSE 3000
|
|
2806
|
+
CMD ["node", "dist/main.js"]
|
|
2807
|
+
\`\`\`
|
|
2808
|
+
|
|
2809
|
+
docker-compose.yml TEMPLATE:
|
|
2733
2810
|
\`\`\`yaml
|
|
2734
|
-
version: '3.8'
|
|
2735
2811
|
services:
|
|
2736
2812
|
api:
|
|
2737
2813
|
build:
|
|
2738
2814
|
context: .
|
|
2739
|
-
dockerfile:
|
|
2815
|
+
dockerfile: projects/api/Dockerfile
|
|
2740
2816
|
ports:
|
|
2741
2817
|
- "3000:3000"
|
|
2742
2818
|
healthcheck:
|
|
2743
|
-
test: ["CMD", "
|
|
2819
|
+
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/health"]
|
|
2744
2820
|
interval: 30s
|
|
2745
2821
|
timeout: 10s
|
|
2746
2822
|
retries: 3
|