@polymorphism-tech/morph-spec 4.3.4 → 4.3.5
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/.morph/.morphversion +5 -0
- package/.morph/config/agents.json +948 -0
- package/.morph/config/config.json +9 -9
- package/.morph/project/context/README.md +17 -0
- package/.morph/project/context/detection-log.md +16 -0
- package/.morph/project/standards/inferred.md +59 -0
- package/.morph/standards/ai-agents/blazor-ui.md +364 -0
- package/.morph/standards/ai-agents/production.md +415 -0
- package/.morph/standards/ai-agents/setup.md +418 -0
- package/.morph/standards/ai-agents/team-orchestration.md +479 -0
- package/.morph/standards/ai-agents/workflows.md +354 -0
- package/.morph/standards/architecture/ddd/aggregates.md +120 -0
- package/.morph/standards/architecture/ddd/entities.md +99 -0
- package/.morph/standards/architecture/ddd/value-objects.md +124 -0
- package/.morph/standards/backend/api/minimal-api.md +494 -0
- package/.morph/standards/backend/api/rest.md +492 -0
- package/.morph/standards/backend/api/validation.md +88 -0
- package/.morph/standards/backend/authentication/passkeys.md +428 -0
- package/.morph/standards/backend/database/ef-core.md +199 -0
- package/.morph/standards/backend/database/migrations.md +393 -0
- package/.morph/standards/backend/database/postgresql/database.md +352 -0
- package/.morph/standards/backend/database/repository-patterns.md +528 -0
- package/.morph/standards/backend/database/vector-search-rag.md +541 -0
- package/.morph/standards/backend/dotnet/async.md +366 -0
- package/.morph/standards/backend/dotnet/core.md +117 -0
- package/.morph/standards/backend/dotnet/di.md +439 -0
- package/.morph/standards/backend/dotnet/program-cs-checklist.md +92 -0
- package/.morph/standards/backend/integrations/asaas/asaas-api.md +216 -0
- package/.morph/standards/backend/integrations/clerk/clerk-auth.md +290 -0
- package/.morph/standards/backend/integrations/hangfire/hangfire-jobs.md +350 -0
- package/.morph/standards/backend/integrations/resend/resend-email.md +385 -0
- package/.morph/standards/context/analytics.md +96 -0
- package/.morph/standards/context/bundles.md +110 -0
- package/.morph/standards/context/priming.md +78 -0
- package/.morph/standards/core/architecture.md +185 -0
- package/.morph/standards/core/coding.md +214 -0
- package/.morph/standards/core/git-branching-strategy.md +403 -0
- package/.morph/standards/core/git.md +185 -0
- package/.morph/standards/core/testing.md +295 -0
- package/.morph/standards/data/nosql/blob-storage.md +102 -0
- package/.morph/standards/data/nosql/cache/redis.md +97 -0
- package/.morph/standards/data/nosql/cosmos-db.md +118 -0
- package/.morph/standards/data/vector-search/azure-ai-search.md +121 -0
- package/.morph/standards/data/vector-search/rag-chunking.md +104 -0
- package/.morph/standards/frontend/blazor/design-checklist.md +222 -0
- package/.morph/standards/frontend/blazor/fluent-ui-setup.md +595 -0
- package/.morph/standards/frontend/blazor/fluent-ui.md +137 -0
- package/.morph/standards/frontend/blazor/html-conversion.md +184 -0
- package/.morph/standards/frontend/blazor/lifecycle.md +195 -0
- package/.morph/standards/frontend/blazor/pitfalls.md +198 -0
- package/.morph/standards/frontend/blazor/state.md +191 -0
- package/.morph/standards/frontend/design-system/animations.md +151 -0
- package/.morph/standards/frontend/design-system/naming.md +64 -0
- package/.morph/standards/frontend/nextjs/nextjs-patterns.md +198 -0
- package/.morph/standards/infrastructure/azure/azure.md +624 -0
- package/.morph/standards/infrastructure/azure/bicep/bicep-patterns.md +422 -0
- package/.morph/standards/infrastructure/azure/devops/azure-devops-setup.md +516 -0
- package/.morph/standards/infrastructure/azure/devops/local-development.md +520 -0
- package/.morph/standards/infrastructure/azure/services/functions.md +486 -0
- package/.morph/standards/infrastructure/azure/services/service-bus.md +459 -0
- package/.morph/standards/infrastructure/azure/services/storage.md +407 -0
- package/.morph/standards/infrastructure/docker/easypanel-deploy.md +196 -0
- package/.morph/standards/infrastructure/supabase/mcp-setup.md +252 -0
- package/.morph/standards/infrastructure/supabase/supabase-auth.md +176 -0
- package/.morph/standards/infrastructure/supabase/supabase-pgvector.md +169 -0
- package/.morph/standards/infrastructure/supabase/supabase-rls.md +184 -0
- package/.morph/standards/infrastructure/supabase/supabase-storage.md +153 -0
- package/.morph/standards/integration/api/graphql.md +91 -0
- package/.morph/standards/integration/api/grpc.md +114 -0
- package/.morph/standards/integration/api/rest-design.md +95 -0
- package/.morph/standards/integration/event-driven/cqrs.md +101 -0
- package/.morph/standards/integration/event-driven/event-sourcing.md +124 -0
- package/.morph/standards/integration/event-driven/service-bus.md +95 -0
- package/.morph/standards/observability/logging.md +131 -0
- package/.morph/standards/observability/metrics.md +121 -0
- package/.morph/standards/observability/monitoring.md +114 -0
- package/.morph/standards/observability/tracing.md +132 -0
- package/.morph/standards/workflows/parallel-execution.md +112 -0
- package/.morph/standards/workflows/thread-management.md +113 -0
- package/.morph/templates/.idea/morph-templates.xml +92 -0
- package/.morph/templates/.vscode/morph-templates.code-snippets +186 -0
- package/.morph/templates/IDE-SNIPPETS.md +266 -0
- package/.morph/templates/README.md +814 -0
- package/.morph/templates/REGISTRY.json +1677 -0
- package/.morph/templates/code/dotnet/backend/repository.cs +141 -0
- package/.morph/templates/code/dotnet/backend/service.cs +139 -0
- package/.morph/templates/code/dotnet/contracts/Commands.cs +74 -0
- package/.morph/templates/code/dotnet/contracts/Entities.cs +25 -0
- package/.morph/templates/code/dotnet/contracts/Queries.cs +74 -0
- package/.morph/templates/code/dotnet/contracts/README.md +74 -0
- package/.morph/templates/code/dotnet/contracts/api-contracts.cs +173 -0
- package/.morph/templates/code/dotnet/contracts/contracts.cs +217 -0
- package/.morph/templates/code/dotnet/database/migration.cs +83 -0
- package/.morph/templates/code/dotnet/frontend/component.razor +239 -0
- package/.morph/templates/code/dotnet/jobs/agent.cs +163 -0
- package/.morph/templates/code/dotnet/jobs/job.cs +171 -0
- package/.morph/templates/code/dotnet/test.cs +239 -0
- package/.morph/templates/code/sql/rls-policy.sql +57 -0
- package/.morph/templates/code/sql/supabase-migration.sql +100 -0
- package/.morph/templates/code/sql/supabase-migration.template.sql +113 -0
- package/.morph/templates/code/typescript/contracts.ts +168 -0
- package/.morph/templates/context/CONTEXT-FEATURE.md +276 -0
- package/.morph/templates/context/CONTEXT.md +181 -0
- package/.morph/templates/docs/proposal.md +182 -0
- package/.morph/templates/docs/spec.md +149 -0
- package/.morph/templates/examples/design-system-examples.md +357 -0
- package/.morph/templates/examples/spec-examples.md +90 -0
- package/.morph/templates/feature/decisions.md +187 -0
- package/.morph/templates/feature/recap.md +146 -0
- package/.morph/templates/feature/tasks.md +199 -0
- package/.morph/templates/infrastructure/azure/Dockerfile.example +82 -0
- package/.morph/templates/infrastructure/azure/README.md +286 -0
- package/.morph/templates/infrastructure/azure/app-insights.bicep +63 -0
- package/.morph/templates/infrastructure/azure/app-service.bicep +164 -0
- package/.morph/templates/infrastructure/azure/container-app-env.bicep +49 -0
- package/.morph/templates/infrastructure/azure/container-app.bicep +156 -0
- package/.morph/templates/infrastructure/azure/deploy-checklist.md +426 -0
- package/.morph/templates/infrastructure/azure/deploy.ps1 +229 -0
- package/.morph/templates/infrastructure/azure/deploy.sh +208 -0
- package/.morph/templates/infrastructure/azure/key-vault.bicep +91 -0
- package/.morph/templates/infrastructure/azure/main.bicep +189 -0
- package/.morph/templates/infrastructure/azure/parameters.dev.json +29 -0
- package/.morph/templates/infrastructure/azure/parameters.prod.json +29 -0
- package/.morph/templates/infrastructure/azure/parameters.staging.json +29 -0
- package/.morph/templates/infrastructure/azure/sql-database.bicep +103 -0
- package/.morph/templates/infrastructure/azure/storage.bicep +106 -0
- package/.morph/templates/infrastructure/docker/Dockerfile.template +58 -0
- package/.morph/templates/infrastructure/docker/docker-compose.template.yml +67 -0
- package/.morph/templates/infrastructure/docker/dockerfile-api.dockerfile +38 -0
- package/.morph/templates/infrastructure/docker/dockerfile-web.dockerfile +48 -0
- package/.morph/templates/infrastructure/docker/easypanel.template.json +54 -0
- package/.morph/templates/infrastructure/github/README.md +593 -0
- package/.morph/templates/infrastructure/github/actions/azure-auth/action.yml.hbs +22 -0
- package/.morph/templates/infrastructure/github/actions/docker-build-push/action.yml.hbs +45 -0
- package/.morph/templates/infrastructure/github/actions/health-check/action.yml.hbs +27 -0
- package/.morph/templates/infrastructure/github/workflows/deploy-azure-app-service.yml.hbs +61 -0
- package/.morph/templates/infrastructure/github/workflows/deploy-easypanel.yml.hbs +31 -0
- package/.morph/templates/infrastructure/github/workflows/docker-build-push.yml.hbs +59 -0
- package/.morph/templates/infrastructure/github/workflows/dotnet-build.yml.hbs +39 -0
- package/.morph/templates/integrations/asaas-client.cs +387 -0
- package/.morph/templates/integrations/asaas-webhook.cs +351 -0
- package/.morph/templates/integrations/azure-identity-config.cs +288 -0
- package/.morph/templates/integrations/clerk-config.cs +258 -0
- package/.morph/templates/meta-prompts/fusion/fusion-agent.md +76 -0
- package/.morph/templates/meta-prompts/fusion/fusion-aggregator.md +100 -0
- package/.morph/templates/meta-prompts/hops/hop-retry.md +78 -0
- package/.morph/templates/meta-prompts/hops/hop-validation.md +97 -0
- package/.morph/templates/meta-prompts/hops/hop-wrapper.md +36 -0
- package/.morph/templates/meta-prompts/parallel-workers/parallel-coordinator.md +113 -0
- package/.morph/templates/meta-prompts/parallel-workers/parallel-worker.md +80 -0
- package/.morph/templates/meta-prompts/squad-leaders/backend-squad.md +90 -0
- package/.morph/templates/meta-prompts/squad-leaders/frontend-squad.md +126 -0
- package/.morph/templates/meta-prompts/squad-leaders/squad-leader.md +43 -0
- package/.morph/templates/meta-prompts/validators/checkpoint-validator.md +107 -0
- package/.morph/templates/meta-prompts/validators/pre-commit-validator.md +95 -0
- package/.morph/templates/saas/subscription.cs +347 -0
- package/.morph/templates/saas/tenant.cs +338 -0
- package/.morph/templates/state.template.json +17 -0
- package/.morph/templates/ui/FluentDesignTheme.cs +149 -0
- package/.morph/templates/ui/MudTheme.cs +281 -0
- package/.morph/templates/ui/design-system.css +226 -0
- package/bin/morph-spec.js +1 -1
- package/package.json +1 -1
- package/src/commands/project/update.js +100 -13
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// ==============================================================================
|
|
2
|
+
// MORPH-SPEC - Storage Account
|
|
3
|
+
// Azure Storage Account with Blob containers
|
|
4
|
+
// ==============================================================================
|
|
5
|
+
|
|
6
|
+
@description('Storage account name (lowercase, no hyphens, 3-24 chars)')
|
|
7
|
+
@minLength(3)
|
|
8
|
+
@maxLength(24)
|
|
9
|
+
param name string
|
|
10
|
+
|
|
11
|
+
@description('Location')
|
|
12
|
+
param location string
|
|
13
|
+
|
|
14
|
+
@description('Tags')
|
|
15
|
+
param tags object = {}
|
|
16
|
+
|
|
17
|
+
@description('SKU (Standard_LRS, Standard_GRS, Standard_ZRS)')
|
|
18
|
+
@allowed(['Standard_LRS', 'Standard_GRS', 'Standard_ZRS', 'Premium_LRS'])
|
|
19
|
+
param sku string = 'Standard_LRS'
|
|
20
|
+
|
|
21
|
+
@description('Create default blob containers')
|
|
22
|
+
param createContainers bool = true
|
|
23
|
+
|
|
24
|
+
// ==============================================================================
|
|
25
|
+
// STORAGE ACCOUNT
|
|
26
|
+
// ==============================================================================
|
|
27
|
+
|
|
28
|
+
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
|
|
29
|
+
name: name
|
|
30
|
+
location: location
|
|
31
|
+
tags: tags
|
|
32
|
+
kind: 'StorageV2'
|
|
33
|
+
sku: {
|
|
34
|
+
name: sku
|
|
35
|
+
}
|
|
36
|
+
properties: {
|
|
37
|
+
accessTier: 'Hot'
|
|
38
|
+
allowBlobPublicAccess: false
|
|
39
|
+
allowSharedKeyAccess: true
|
|
40
|
+
minimumTlsVersion: 'TLS1_2'
|
|
41
|
+
supportsHttpsTrafficOnly: true
|
|
42
|
+
networkAcls: {
|
|
43
|
+
defaultAction: 'Allow'
|
|
44
|
+
bypass: 'AzureServices'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ==============================================================================
|
|
50
|
+
// BLOB SERVICE
|
|
51
|
+
// ==============================================================================
|
|
52
|
+
|
|
53
|
+
resource blobService 'Microsoft.Storage/storageAccounts/blobServices@2023-01-01' = {
|
|
54
|
+
parent: storageAccount
|
|
55
|
+
name: 'default'
|
|
56
|
+
properties: {
|
|
57
|
+
deleteRetentionPolicy: {
|
|
58
|
+
enabled: true
|
|
59
|
+
days: 7
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ==============================================================================
|
|
65
|
+
// DEFAULT CONTAINERS
|
|
66
|
+
// ==============================================================================
|
|
67
|
+
|
|
68
|
+
resource uploadsContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2023-01-01' = if (createContainers) {
|
|
69
|
+
parent: blobService
|
|
70
|
+
name: 'uploads'
|
|
71
|
+
properties: {
|
|
72
|
+
publicAccess: 'None'
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
resource reportsContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2023-01-01' = if (createContainers) {
|
|
77
|
+
parent: blobService
|
|
78
|
+
name: 'reports'
|
|
79
|
+
properties: {
|
|
80
|
+
publicAccess: 'None'
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
resource backupsContainer 'Microsoft.Storage/storageAccounts/blobServices/containers@2023-01-01' = if (createContainers) {
|
|
85
|
+
parent: blobService
|
|
86
|
+
name: 'backups'
|
|
87
|
+
properties: {
|
|
88
|
+
publicAccess: 'None'
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// ==============================================================================
|
|
93
|
+
// OUTPUTS
|
|
94
|
+
// ==============================================================================
|
|
95
|
+
|
|
96
|
+
@description('Storage Account ID')
|
|
97
|
+
output id string = storageAccount.id
|
|
98
|
+
|
|
99
|
+
@description('Storage Account name')
|
|
100
|
+
output name string = storageAccount.name
|
|
101
|
+
|
|
102
|
+
@description('Primary blob endpoint')
|
|
103
|
+
output primaryBlobEndpoint string = storageAccount.properties.primaryEndpoints.blob
|
|
104
|
+
|
|
105
|
+
@description('Connection string')
|
|
106
|
+
output connectionString string = 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value};EndpointSuffix=core.windows.net'
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Multi-stage Dockerfile for Next.js Production Build
|
|
2
|
+
# Optimized for Next.js 15 with App Router
|
|
3
|
+
|
|
4
|
+
FROM node:20-alpine AS base
|
|
5
|
+
|
|
6
|
+
# Install dependencies only when needed
|
|
7
|
+
FROM base AS deps
|
|
8
|
+
RUN apk add --no-cache libc6-compat
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
|
|
11
|
+
# Copy package files
|
|
12
|
+
COPY package.json package-lock.json* ./
|
|
13
|
+
RUN npm ci
|
|
14
|
+
|
|
15
|
+
# Rebuild the source code only when needed
|
|
16
|
+
FROM base AS builder
|
|
17
|
+
WORKDIR /app
|
|
18
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
19
|
+
COPY . .
|
|
20
|
+
|
|
21
|
+
# Set build-time environment variables
|
|
22
|
+
ENV NEXT_TELEMETRY_DISABLED 1
|
|
23
|
+
|
|
24
|
+
# Build Next.js application
|
|
25
|
+
RUN npm run build
|
|
26
|
+
|
|
27
|
+
# Production image, copy all the files and run next
|
|
28
|
+
FROM base AS runner
|
|
29
|
+
WORKDIR /app
|
|
30
|
+
|
|
31
|
+
ENV NODE_ENV production
|
|
32
|
+
ENV NEXT_TELEMETRY_DISABLED 1
|
|
33
|
+
|
|
34
|
+
# Create nextjs user
|
|
35
|
+
RUN addgroup --system --gid 1001 nodejs
|
|
36
|
+
RUN adduser --system --uid 1001 nextjs
|
|
37
|
+
|
|
38
|
+
# Copy built application
|
|
39
|
+
COPY --from=builder /app/public ./public
|
|
40
|
+
|
|
41
|
+
# Set the correct permission for prerender cache
|
|
42
|
+
RUN mkdir .next
|
|
43
|
+
RUN chown nextjs:nodejs .next
|
|
44
|
+
|
|
45
|
+
# Automatically leverage output traces to reduce image size
|
|
46
|
+
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
47
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
48
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
49
|
+
|
|
50
|
+
USER nextjs
|
|
51
|
+
|
|
52
|
+
EXPOSE 3000
|
|
53
|
+
|
|
54
|
+
ENV PORT 3000
|
|
55
|
+
ENV HOSTNAME "0.0.0.0"
|
|
56
|
+
|
|
57
|
+
# Run Next.js server
|
|
58
|
+
CMD ["node", "server.js"]
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Docker Compose for Local Development
|
|
2
|
+
# Next.js + Supabase Stack
|
|
3
|
+
|
|
4
|
+
version: '3.8'
|
|
5
|
+
|
|
6
|
+
services:
|
|
7
|
+
# Next.js Application
|
|
8
|
+
app:
|
|
9
|
+
build:
|
|
10
|
+
context: .
|
|
11
|
+
dockerfile: Dockerfile.dev
|
|
12
|
+
container_name: {{kebabCase FEATURE_NAME}}-app
|
|
13
|
+
ports:
|
|
14
|
+
- "3000:3000"
|
|
15
|
+
environment:
|
|
16
|
+
- NODE_ENV=development
|
|
17
|
+
- NEXT_PUBLIC_SUPABASE_URL=${NEXT_PUBLIC_SUPABASE_URL}
|
|
18
|
+
- NEXT_PUBLIC_SUPABASE_ANON_KEY=${NEXT_PUBLIC_SUPABASE_ANON_KEY}
|
|
19
|
+
- SUPABASE_SERVICE_ROLE_KEY=${SUPABASE_SERVICE_ROLE_KEY}
|
|
20
|
+
volumes:
|
|
21
|
+
- .:/app
|
|
22
|
+
- /app/node_modules
|
|
23
|
+
- /app/.next
|
|
24
|
+
depends_on:
|
|
25
|
+
- postgres
|
|
26
|
+
networks:
|
|
27
|
+
- app-network
|
|
28
|
+
|
|
29
|
+
# PostgreSQL Database (Local Supabase alternative)
|
|
30
|
+
postgres:
|
|
31
|
+
image: postgres:15-alpine
|
|
32
|
+
container_name: {{kebabCase FEATURE_NAME}}-postgres
|
|
33
|
+
restart: unless-stopped
|
|
34
|
+
ports:
|
|
35
|
+
- "5432:5432"
|
|
36
|
+
environment:
|
|
37
|
+
POSTGRES_USER: postgres
|
|
38
|
+
POSTGRES_PASSWORD: postgres
|
|
39
|
+
POSTGRES_DB: {{snakeCase FEATURE_NAME}}
|
|
40
|
+
volumes:
|
|
41
|
+
- postgres-data:/var/lib/postgresql/data
|
|
42
|
+
- ./supabase/migrations:/docker-entrypoint-initdb.d
|
|
43
|
+
networks:
|
|
44
|
+
- app-network
|
|
45
|
+
|
|
46
|
+
# Supabase Studio (Database UI - optional)
|
|
47
|
+
studio:
|
|
48
|
+
image: supabase/studio:latest
|
|
49
|
+
container_name: {{kebabCase FEATURE_NAME}}-studio
|
|
50
|
+
restart: unless-stopped
|
|
51
|
+
ports:
|
|
52
|
+
- "3001:3000"
|
|
53
|
+
environment:
|
|
54
|
+
SUPABASE_URL: http://kong:8000
|
|
55
|
+
STUDIO_PG_META_URL: http://meta:8080
|
|
56
|
+
SUPABASE_ANON_KEY: ${SUPABASE_ANON_KEY}
|
|
57
|
+
SUPABASE_SERVICE_KEY: ${SUPABASE_SERVICE_ROLE_KEY}
|
|
58
|
+
networks:
|
|
59
|
+
- app-network
|
|
60
|
+
|
|
61
|
+
volumes:
|
|
62
|
+
postgres-data:
|
|
63
|
+
driver: local
|
|
64
|
+
|
|
65
|
+
networks:
|
|
66
|
+
app-network:
|
|
67
|
+
driver: bridge
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# Dockerfile: .NET 10 API ({{titleCase FEATURE_NAME}})
|
|
3
|
+
# Stack: Next.js + Supabase + .NET API
|
|
4
|
+
# Generated by MORPH Framework
|
|
5
|
+
# ============================================================
|
|
6
|
+
|
|
7
|
+
# Stage 1: Build
|
|
8
|
+
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
|
9
|
+
WORKDIR /src
|
|
10
|
+
|
|
11
|
+
# Copy project file and restore dependencies
|
|
12
|
+
COPY *.csproj .
|
|
13
|
+
RUN dotnet restore
|
|
14
|
+
|
|
15
|
+
# Copy source code and publish
|
|
16
|
+
COPY . .
|
|
17
|
+
RUN dotnet publish -c Release -o /app/publish --no-restore
|
|
18
|
+
|
|
19
|
+
# Stage 2: Runtime
|
|
20
|
+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
|
21
|
+
WORKDIR /app
|
|
22
|
+
|
|
23
|
+
# Copy published output
|
|
24
|
+
COPY --from=build /app/publish .
|
|
25
|
+
|
|
26
|
+
# Configuration
|
|
27
|
+
ENV ASPNETCORE_URLS=http://+:8080
|
|
28
|
+
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
29
|
+
|
|
30
|
+
# Expose port
|
|
31
|
+
EXPOSE 8080
|
|
32
|
+
|
|
33
|
+
# Health check
|
|
34
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
35
|
+
CMD curl -f http://localhost:8080/health || exit 1
|
|
36
|
+
|
|
37
|
+
# Entrypoint
|
|
38
|
+
ENTRYPOINT ["dotnet", "Api.dll"]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# ============================================================
|
|
2
|
+
# Dockerfile: Next.js Frontend ({{titleCase FEATURE_NAME}})
|
|
3
|
+
# Stack: Next.js + Supabase
|
|
4
|
+
# Generated by MORPH Framework
|
|
5
|
+
# Requires: output: "standalone" in next.config.ts
|
|
6
|
+
# ============================================================
|
|
7
|
+
|
|
8
|
+
# Stage 1: Install dependencies
|
|
9
|
+
FROM node:22-alpine AS deps
|
|
10
|
+
WORKDIR /app
|
|
11
|
+
COPY package.json package-lock.json ./
|
|
12
|
+
RUN npm ci --omit=dev
|
|
13
|
+
|
|
14
|
+
# Stage 2: Build application
|
|
15
|
+
FROM node:22-alpine AS builder
|
|
16
|
+
WORKDIR /app
|
|
17
|
+
COPY --from=deps /app/node_modules ./node_modules
|
|
18
|
+
COPY . .
|
|
19
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
20
|
+
RUN npm run build
|
|
21
|
+
|
|
22
|
+
# Stage 3: Production runtime
|
|
23
|
+
FROM node:22-alpine AS runner
|
|
24
|
+
WORKDIR /app
|
|
25
|
+
|
|
26
|
+
ENV NODE_ENV=production
|
|
27
|
+
ENV NEXT_TELEMETRY_DISABLED=1
|
|
28
|
+
|
|
29
|
+
# Create non-root user
|
|
30
|
+
RUN addgroup --system --gid 1001 nodejs && \
|
|
31
|
+
adduser --system --uid 1001 nextjs
|
|
32
|
+
|
|
33
|
+
# Copy build output
|
|
34
|
+
COPY --from=builder /app/public ./public
|
|
35
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
36
|
+
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
37
|
+
|
|
38
|
+
# Switch to non-root user
|
|
39
|
+
USER nextjs
|
|
40
|
+
|
|
41
|
+
# Expose port
|
|
42
|
+
EXPOSE 3000
|
|
43
|
+
|
|
44
|
+
ENV PORT=3000
|
|
45
|
+
ENV HOSTNAME="0.0.0.0"
|
|
46
|
+
|
|
47
|
+
# Start server
|
|
48
|
+
CMD ["node", "server.js"]
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{kebabCase FEATURE_NAME}}",
|
|
3
|
+
"services": [
|
|
4
|
+
{
|
|
5
|
+
"type": "app",
|
|
6
|
+
"data": {
|
|
7
|
+
"projectName": "{{kebabCase FEATURE_NAME}}",
|
|
8
|
+
"serviceName": "{{kebabCase FEATURE_NAME}}-app",
|
|
9
|
+
"source": {
|
|
10
|
+
"type": "github",
|
|
11
|
+
"owner": "{{GITHUB_OWNER}}",
|
|
12
|
+
"repo": "{{GITHUB_REPO}}",
|
|
13
|
+
"ref": "main",
|
|
14
|
+
"autoDeploy": true
|
|
15
|
+
},
|
|
16
|
+
"build": {
|
|
17
|
+
"type": "dockerfile",
|
|
18
|
+
"dockerfile": "Dockerfile"
|
|
19
|
+
},
|
|
20
|
+
"deploy": {
|
|
21
|
+
"replicas": 1,
|
|
22
|
+
"command": null,
|
|
23
|
+
"zeroDowntime": true
|
|
24
|
+
},
|
|
25
|
+
"env": [
|
|
26
|
+
{
|
|
27
|
+
"key": "NODE_ENV",
|
|
28
|
+
"value": "production"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"key": "NEXT_PUBLIC_SUPABASE_URL",
|
|
32
|
+
"value": "${NEXT_PUBLIC_SUPABASE_URL}"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"key": "NEXT_PUBLIC_SUPABASE_ANON_KEY",
|
|
36
|
+
"value": "${NEXT_PUBLIC_SUPABASE_ANON_KEY}"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"key": "SUPABASE_SERVICE_ROLE_KEY",
|
|
40
|
+
"value": "${SUPABASE_SERVICE_ROLE_KEY}"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"domains": [
|
|
44
|
+
{
|
|
45
|
+
"host": "{{kebabCase FEATURE_NAME}}.easypanel.host",
|
|
46
|
+
"port": 3000,
|
|
47
|
+
"https": true
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"mounts": []
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|