@turboops/cli 1.0.0-dev.614 → 1.0.0-dev.616
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 +117 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2039,17 +2039,17 @@ async function createDockerSetupWithAI(projectId, verbose = false) {
|
|
|
2039
2039
|
|
|
2040
2040
|
=== ZU ERSTELLENDE DATEIEN ===
|
|
2041
2041
|
|
|
2042
|
-
1. docker-compose.yml (Root-Ebene) -
|
|
2042
|
+
1. docker-compose.yml (Root-Ebene) - Datenbanken + Application Services
|
|
2043
|
+
WICHTIG: Keine Environment-Variablen f\xFCr Application Services!
|
|
2044
|
+
- Environment-Variablen f\xFCr api/app werden von TurboOps zur Deployment-Zeit injiziert
|
|
2045
|
+
- Datenbanken bekommen ihre Konfiguration (Credentials kommen von TurboOps)
|
|
2043
2046
|
\`\`\`yaml
|
|
2044
2047
|
services:
|
|
2045
|
-
# === DATENBANKEN
|
|
2048
|
+
# === DATENBANKEN ===
|
|
2046
2049
|
mongo:
|
|
2047
2050
|
image: mongo:7
|
|
2048
2051
|
volumes:
|
|
2049
2052
|
- mongo_data:/data/db
|
|
2050
|
-
environment:
|
|
2051
|
-
- MONGO_INITDB_ROOT_USERNAME=\${MONGO_USER:-admin}
|
|
2052
|
-
- MONGO_INITDB_ROOT_PASSWORD=\${MONGO_PASSWORD}
|
|
2053
2053
|
healthcheck:
|
|
2054
2054
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
2055
2055
|
interval: 30s
|
|
@@ -2068,17 +2068,13 @@ services:
|
|
|
2068
2068
|
retries: 3
|
|
2069
2069
|
restart: unless-stopped
|
|
2070
2070
|
|
|
2071
|
-
# === APPLICATION SERVICES ===
|
|
2071
|
+
# === APPLICATION SERVICES (keine environment - kommt von TurboOps!) ===
|
|
2072
2072
|
api:
|
|
2073
2073
|
build:
|
|
2074
2074
|
context: .
|
|
2075
2075
|
dockerfile: ./projects/api/Dockerfile # oder ./api/Dockerfile
|
|
2076
|
-
|
|
2077
|
-
- "3000
|
|
2078
|
-
environment:
|
|
2079
|
-
- NODE_ENV=production
|
|
2080
|
-
- MONGO_URI=mongodb://\${MONGO_USER:-admin}:\${MONGO_PASSWORD}@mongo:27017/app?authSource=admin
|
|
2081
|
-
- REDIS_URL=redis://redis:6379
|
|
2076
|
+
expose:
|
|
2077
|
+
- "3000"
|
|
2082
2078
|
depends_on:
|
|
2083
2079
|
mongo:
|
|
2084
2080
|
condition: service_healthy
|
|
@@ -2095,11 +2091,9 @@ services:
|
|
|
2095
2091
|
app:
|
|
2096
2092
|
build:
|
|
2097
2093
|
context: .
|
|
2098
|
-
dockerfile: ./projects/app/Dockerfile # oder ./
|
|
2099
|
-
|
|
2100
|
-
- "
|
|
2101
|
-
environment:
|
|
2102
|
-
- NUXT_PUBLIC_API_URL=http://api:3000
|
|
2094
|
+
dockerfile: ./projects/app/Dockerfile # oder ./api/Dockerfile
|
|
2095
|
+
expose:
|
|
2096
|
+
- "3000"
|
|
2103
2097
|
depends_on:
|
|
2104
2098
|
api:
|
|
2105
2099
|
condition: service_healthy
|
|
@@ -2158,10 +2152,14 @@ dist
|
|
|
2158
2152
|
coverage
|
|
2159
2153
|
\`\`\`
|
|
2160
2154
|
|
|
2161
|
-
=== WICHTIGE REGELN ===
|
|
2155
|
+
=== WICHTIGE REGELN F\xDCR TURBOOPS ===
|
|
2162
2156
|
- KRITISCH: IMMER \`npm ci --ignore-scripts\` verwenden (verhindert husky/prepare Fehler!)
|
|
2157
|
+
- KRITISCH: KEINE \`ports:\` \u2192 Verwende \`expose:\` (nur im Docker-Netzwerk sichtbar)
|
|
2158
|
+
- KRITISCH: KEINE \`environment:\` f\xFCr Application Services (api, app) \u2192 Env-Variablen werden von TurboOps zur Deployment-Zeit injiziert
|
|
2159
|
+
- Datenbank-Services (mongo, redis, etc.) OHNE environment - Credentials kommen von TurboOps
|
|
2160
|
+
- Ein Reverse-Proxy (Traefik) routet externe Anfragen
|
|
2163
2161
|
- Pr\xFCfe die tats\xE4chliche Projektstruktur (projects/, packages/, apps/, oder flach)
|
|
2164
|
-
- Passe Pfade entsprechend an
|
|
2162
|
+
- Passe Dockerfile-Pfade entsprechend an
|
|
2165
2163
|
- NestJS: CMD ["node", "dist/main.js"]
|
|
2166
2164
|
- Nuxt: CMD ["node", ".output/server/index.mjs"]
|
|
2167
2165
|
- Nutze wget statt curl f\xFCr healthchecks (curl nicht in alpine)
|
|
@@ -2684,6 +2682,63 @@ EXPOSE 3000
|
|
|
2684
2682
|
CMD ["node", "dist/main.js"]
|
|
2685
2683
|
\`\`\`
|
|
2686
2684
|
|
|
2685
|
+
docker-compose.yml TEMPLATE:
|
|
2686
|
+
\`\`\`yaml
|
|
2687
|
+
services:
|
|
2688
|
+
# === DATENBANKEN (erkenne aus package.json: mongoose \u2192 mongo, ioredis \u2192 redis) ===
|
|
2689
|
+
mongo:
|
|
2690
|
+
image: mongo:7
|
|
2691
|
+
volumes:
|
|
2692
|
+
- mongo_data:/data/db
|
|
2693
|
+
healthcheck:
|
|
2694
|
+
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
2695
|
+
interval: 30s
|
|
2696
|
+
timeout: 10s
|
|
2697
|
+
retries: 3
|
|
2698
|
+
restart: unless-stopped
|
|
2699
|
+
|
|
2700
|
+
redis:
|
|
2701
|
+
image: redis:7-alpine
|
|
2702
|
+
volumes:
|
|
2703
|
+
- redis_data:/data
|
|
2704
|
+
healthcheck:
|
|
2705
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
2706
|
+
interval: 30s
|
|
2707
|
+
timeout: 10s
|
|
2708
|
+
retries: 3
|
|
2709
|
+
restart: unless-stopped
|
|
2710
|
+
|
|
2711
|
+
# === APPLICATION SERVICES (KEINE environment!) ===
|
|
2712
|
+
api:
|
|
2713
|
+
build:
|
|
2714
|
+
context: .
|
|
2715
|
+
dockerfile: projects/api/Dockerfile
|
|
2716
|
+
expose:
|
|
2717
|
+
- "3000"
|
|
2718
|
+
depends_on:
|
|
2719
|
+
mongo:
|
|
2720
|
+
condition: service_healthy
|
|
2721
|
+
redis:
|
|
2722
|
+
condition: service_healthy
|
|
2723
|
+
healthcheck:
|
|
2724
|
+
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/health"]
|
|
2725
|
+
interval: 30s
|
|
2726
|
+
timeout: 10s
|
|
2727
|
+
retries: 3
|
|
2728
|
+
restart: unless-stopped
|
|
2729
|
+
|
|
2730
|
+
volumes:
|
|
2731
|
+
mongo_data:
|
|
2732
|
+
redis_data:
|
|
2733
|
+
\`\`\`
|
|
2734
|
+
|
|
2735
|
+
WICHTIG - TURBOOPS DEPLOYMENT:
|
|
2736
|
+
- KEINE \`ports:\` \u2192 Verwende \`expose:\` (nur im Docker-Netzwerk sichtbar)
|
|
2737
|
+
- KEINE \`environment:\` f\xFCr Application Services \u2192 Env-Variablen werden von TurboOps zur Deployment-Zeit injiziert
|
|
2738
|
+
- Datenbanken OHNE environment - Credentials kommen von TurboOps
|
|
2739
|
+
- Ein Reverse-Proxy (Traefik) routet externe Anfragen
|
|
2740
|
+
- Verhindert Port-Konflikte bei mehreren Projekten auf einem Server
|
|
2741
|
+
|
|
2687
2742
|
Erstelle alle notwendigen Dateien.`;
|
|
2688
2743
|
const success = await aiToolsService.runWithPrompt(tool, prompt);
|
|
2689
2744
|
if (success) {
|
|
@@ -2809,19 +2864,60 @@ CMD ["node", "dist/main.js"]
|
|
|
2809
2864
|
docker-compose.yml TEMPLATE:
|
|
2810
2865
|
\`\`\`yaml
|
|
2811
2866
|
services:
|
|
2867
|
+
# === DATENBANKEN (erkenne aus package.json: mongoose \u2192 mongo, ioredis \u2192 redis) ===
|
|
2868
|
+
mongo:
|
|
2869
|
+
image: mongo:7
|
|
2870
|
+
volumes:
|
|
2871
|
+
- mongo_data:/data/db
|
|
2872
|
+
healthcheck:
|
|
2873
|
+
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
2874
|
+
interval: 30s
|
|
2875
|
+
timeout: 10s
|
|
2876
|
+
retries: 3
|
|
2877
|
+
restart: unless-stopped
|
|
2878
|
+
|
|
2879
|
+
redis:
|
|
2880
|
+
image: redis:7-alpine
|
|
2881
|
+
volumes:
|
|
2882
|
+
- redis_data:/data
|
|
2883
|
+
healthcheck:
|
|
2884
|
+
test: ["CMD", "redis-cli", "ping"]
|
|
2885
|
+
interval: 30s
|
|
2886
|
+
timeout: 10s
|
|
2887
|
+
retries: 3
|
|
2888
|
+
restart: unless-stopped
|
|
2889
|
+
|
|
2890
|
+
# === APPLICATION SERVICES (KEINE environment!) ===
|
|
2812
2891
|
api:
|
|
2813
2892
|
build:
|
|
2814
2893
|
context: .
|
|
2815
2894
|
dockerfile: projects/api/Dockerfile
|
|
2816
|
-
|
|
2817
|
-
- "3000
|
|
2895
|
+
expose:
|
|
2896
|
+
- "3000"
|
|
2897
|
+
depends_on:
|
|
2898
|
+
mongo:
|
|
2899
|
+
condition: service_healthy
|
|
2900
|
+
redis:
|
|
2901
|
+
condition: service_healthy
|
|
2818
2902
|
healthcheck:
|
|
2819
2903
|
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/health"]
|
|
2820
2904
|
interval: 30s
|
|
2821
2905
|
timeout: 10s
|
|
2822
2906
|
retries: 3
|
|
2907
|
+
restart: unless-stopped
|
|
2908
|
+
|
|
2909
|
+
volumes:
|
|
2910
|
+
mongo_data:
|
|
2911
|
+
redis_data:
|
|
2823
2912
|
\`\`\`
|
|
2824
2913
|
|
|
2914
|
+
WICHTIG - TURBOOPS DEPLOYMENT:
|
|
2915
|
+
- KEINE \`ports:\` \u2192 Verwende \`expose:\` (nur im Docker-Netzwerk sichtbar)
|
|
2916
|
+
- KEINE \`environment:\` f\xFCr Application Services \u2192 Env-Variablen werden von TurboOps zur Deployment-Zeit injiziert
|
|
2917
|
+
- Datenbanken OHNE environment - Credentials kommen von TurboOps
|
|
2918
|
+
- Ein Reverse-Proxy (Traefik) routet externe Anfragen
|
|
2919
|
+
- Verhindert Port-Konflikte bei mehreren Projekten auf einem Server
|
|
2920
|
+
|
|
2825
2921
|
Erstelle alle notwendigen Dateien.`;
|
|
2826
2922
|
var dockerCommand = new Command6("docker").description("Manage Docker configuration");
|
|
2827
2923
|
dockerCommand.command("generate").description("Docker-Setup (docker-compose + Dockerfiles) mit AI erstellen").option("-f, --force", "Bestehende Dateien \xFCberschreiben").action(async (options) => {
|