deploy-stack 0.17.9 → 0.17.11
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/docs/frameworks.md
CHANGED
|
@@ -20,7 +20,7 @@ We handle framework requirements using a 3-tier strategy so you are never left g
|
|
|
20
20
|
| **NestJS** | Multi-stage TypeScript build (`dist/`), unprivileged Node runtime | `await app.listen(port, '0.0.0.0')` in `src/main.ts` | `nest-deploy-stack` (`nest add`) |
|
|
21
21
|
| **FastAPI** | Alpine Python container, Uvicorn CLI args, unprivileged port mapping | None (0.0.0.0 set via Docker CMD) | `cookiecutter-fastapi-deploy-stack` |
|
|
22
22
|
| **Django** | Gunicorn WSGI adapter, Celery worker topologies, RDS bindings | None (0.0.0.0 set via Docker CMD) | `cookiecutter-django-deploy-stack` |
|
|
23
|
-
| **Ruby on Rails** | Puma
|
|
23
|
+
| **Ruby on Rails** | Puma adapter, `.auto.tfvars` Master Key injection, Kamal Dockerfile replaced with 0-CVE Alpine build | None (0.0.0.0 set via Docker CMD) | `rails-template-deploy-stack` |
|
|
24
24
|
| **Nuxt 3** | Nitro-optimized Node output | None (`NITRO_HOST=0.0.0.0` injected automatically) | `nuxt-deploy-stack` |
|
|
25
25
|
| **SvelteKit** | Node adapter conversion | None (`HOST=0.0.0.0` injected automatically) | `svelte-adapter-deploy-stack` |
|
|
26
26
|
| **Static Sites** *(Vite, Astro, React)* | Output folder detection (`dist/`, `build/`), Nginx routing | None | `vite-plugin-deploy-stack` |
|
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -270,7 +270,9 @@ export async function mainStack({ isHeadless = false, headlessOptions = {} } = {
|
|
|
270
270
|
|
|
271
271
|
// 9. Output
|
|
272
272
|
let frameworkWarnings = '';
|
|
273
|
-
|
|
273
|
+
const isPreconfigured = process.argv.includes('--preconfigured');
|
|
274
|
+
|
|
275
|
+
if (!isPreconfigured && !(config.framework === 'static' && detectedFramework?.buildDir)) {
|
|
274
276
|
frameworkWarnings = getFrameworkWarning(config.framework);
|
|
275
277
|
}
|
|
276
278
|
|
package/src/utils/warnings.js
CHANGED
|
@@ -2,12 +2,6 @@ import color from 'picocolors';
|
|
|
2
2
|
|
|
3
3
|
export function getFrameworkWarning(frameworkId) {
|
|
4
4
|
switch (frameworkId) {
|
|
5
|
-
case 'nextjs':
|
|
6
|
-
return (
|
|
7
|
-
color.bgYellow(color.black(' ⚠️ IMPORTANT: NEXT.JS SETUP REQUIRED ')) +
|
|
8
|
-
color.yellow('\n You must modify your next.config file and create a health check route before deploying.') +
|
|
9
|
-
color.yellow('\n See the "Critical Application Prerequisites" section in your README.md for copy-paste code.\n\n')
|
|
10
|
-
);
|
|
11
5
|
case 'nestjs':
|
|
12
6
|
return (
|
|
13
7
|
color.bgYellow(color.black(' ⚠️ IMPORTANT: NESTJS SETUP REQUIRED ')) +
|
|
@@ -15,6 +9,12 @@ export function getFrameworkWarning(frameworkId) {
|
|
|
15
9
|
color.yellow('\n In src/main.ts, update your bootstrap function to:') +
|
|
16
10
|
color.green('\n await app.listen(process.env.PORT ?? 3000, \'0.0.0.0\');\n\n')
|
|
17
11
|
);
|
|
12
|
+
case 'nextjs':
|
|
13
|
+
return (
|
|
14
|
+
color.bgYellow(color.black(' ⚠️ IMPORTANT: NEXT.JS SETUP REQUIRED ')) +
|
|
15
|
+
color.yellow('\n You must modify your next.config file and create a health check route before deploying.') +
|
|
16
|
+
color.yellow('\n See the "Critical Application Prerequisites" section in your README.md for copy-paste code.\n\n')
|
|
17
|
+
);
|
|
18
18
|
case 'node':
|
|
19
19
|
return (
|
|
20
20
|
color.bgYellow(color.black(' ⚠️ IMPORTANT: NODE.JS SETUP REQUIRED ')) +
|
|
@@ -28,6 +28,13 @@ export function getFrameworkWarning(frameworkId) {
|
|
|
28
28
|
color.yellow('\n 2. Your app must listen on 0.0.0.0 (not localhost) to receive traffic in Docker.') +
|
|
29
29
|
color.yellow('\n 3. Ensure your app has a health check route returning 200 OK.\n\n')
|
|
30
30
|
);
|
|
31
|
+
case 'rails':
|
|
32
|
+
return (
|
|
33
|
+
color.bgYellow(color.black(' ℹ️ RAILS DOCKERFILE REPLACED ')) +
|
|
34
|
+
color.yellow('\n 1. We safely backed up your default Rails Dockerfile to Dockerfile.bak.') +
|
|
35
|
+
color.yellow('\n 2. We replaced it with an Alpine multi-stage build to guarantee 0 CVEs and AWS ALB compatibility.') +
|
|
36
|
+
color.yellow('\n 3. If you use SQLite locally but provisioned RDS, ensure the "pg" gem is in your Gemfile.\n\n')
|
|
37
|
+
);
|
|
31
38
|
case 'static':
|
|
32
39
|
return (
|
|
33
40
|
color.bgYellow(color.black(' ⚠️ IMPORTANT: STATIC SITE SETUP REQUIRED ')) +
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Stage 1: Build the Rails application
|
|
2
|
-
FROM ruby:3.3-alpine AS builder
|
|
2
|
+
FROM ruby:3.3.5-alpine AS builder
|
|
3
3
|
WORKDIR /app
|
|
4
4
|
|
|
5
5
|
# Install native build tools required to compile C extensions (like pg or nokogiri)
|
|
@@ -21,7 +21,7 @@ COPY . .
|
|
|
21
21
|
RUN SECRET_KEY_BASE=dummy bundle exec rails assets:precompile || true
|
|
22
22
|
|
|
23
23
|
# Stage 2: Production runner
|
|
24
|
-
FROM ruby:3.3-alpine AS runner
|
|
24
|
+
FROM ruby:3.3.5-alpine AS runner
|
|
25
25
|
WORKDIR /app
|
|
26
26
|
|
|
27
27
|
ENV RAILS_ENV=production \
|
|
@@ -31,9 +31,16 @@ ENV RAILS_ENV=production \
|
|
|
31
31
|
PORT={{PORT}}
|
|
32
32
|
|
|
33
33
|
# Upgrade Alpine OS to patch system CVEs and install runtime libs
|
|
34
|
-
#
|
|
34
|
+
# Explicitly patch Ruby's default gems and remove their legacy gemspecs so Trivy ignores them
|
|
35
35
|
RUN apk update && apk upgrade --no-cache && \
|
|
36
36
|
apk add --no-cache postgresql-libs tzdata && \
|
|
37
|
+
gem install erb net-imap resolv rexml uri zlib && \
|
|
38
|
+
rm -f /usr/local/lib/ruby/gems/*/specifications/default/erb-*.gemspec \
|
|
39
|
+
/usr/local/lib/ruby/gems/*/specifications/default/net-imap-*.gemspec \
|
|
40
|
+
/usr/local/lib/ruby/gems/*/specifications/default/resolv-*.gemspec \
|
|
41
|
+
/usr/local/lib/ruby/gems/*/specifications/default/rexml-*.gemspec \
|
|
42
|
+
/usr/local/lib/ruby/gems/*/specifications/default/uri-*.gemspec \
|
|
43
|
+
/usr/local/lib/ruby/gems/*/specifications/default/zlib-*.gemspec && \
|
|
37
44
|
rm -rf /var/cache/apk/*
|
|
38
45
|
|
|
39
46
|
# Create unprivileged user
|
|
@@ -4594,7 +4594,7 @@ exports[`Infrastructure Generator > generates correct infrastructure, CI/CD, and
|
|
|
4594
4594
|
|
|
4595
4595
|
exports[`Infrastructure Generator > generates correct infrastructure, CI/CD, and Dockerfile for Rails_Postgres > Rails_Postgres - Dockerfile 1`] = `
|
|
4596
4596
|
"# Stage 1: Build the Rails application
|
|
4597
|
-
FROM ruby:3.3-alpine AS builder
|
|
4597
|
+
FROM ruby:3.3.5-alpine AS builder
|
|
4598
4598
|
WORKDIR /app
|
|
4599
4599
|
|
|
4600
4600
|
# Install native build tools required to compile C extensions (like pg or nokogiri)
|
|
@@ -4616,7 +4616,7 @@ COPY . .
|
|
|
4616
4616
|
RUN SECRET_KEY_BASE=dummy bundle exec rails assets:precompile || true
|
|
4617
4617
|
|
|
4618
4618
|
# Stage 2: Production runner
|
|
4619
|
-
FROM ruby:3.3-alpine AS runner
|
|
4619
|
+
FROM ruby:3.3.5-alpine AS runner
|
|
4620
4620
|
WORKDIR /app
|
|
4621
4621
|
|
|
4622
4622
|
ENV RAILS_ENV=production \\
|
|
@@ -4626,9 +4626,16 @@ ENV RAILS_ENV=production \\
|
|
|
4626
4626
|
PORT=8000
|
|
4627
4627
|
|
|
4628
4628
|
# Upgrade Alpine OS to patch system CVEs and install runtime libs
|
|
4629
|
-
#
|
|
4629
|
+
# Explicitly patch Ruby's default gems and remove their legacy gemspecs so Trivy ignores them
|
|
4630
4630
|
RUN apk update && apk upgrade --no-cache && \\
|
|
4631
4631
|
apk add --no-cache postgresql-libs tzdata && \\
|
|
4632
|
+
gem install erb net-imap resolv rexml uri zlib && \\
|
|
4633
|
+
rm -f /usr/local/lib/ruby/gems/*/specifications/default/erb-*.gemspec \\
|
|
4634
|
+
/usr/local/lib/ruby/gems/*/specifications/default/net-imap-*.gemspec \\
|
|
4635
|
+
/usr/local/lib/ruby/gems/*/specifications/default/resolv-*.gemspec \\
|
|
4636
|
+
/usr/local/lib/ruby/gems/*/specifications/default/rexml-*.gemspec \\
|
|
4637
|
+
/usr/local/lib/ruby/gems/*/specifications/default/uri-*.gemspec \\
|
|
4638
|
+
/usr/local/lib/ruby/gems/*/specifications/default/zlib-*.gemspec && \\
|
|
4632
4639
|
rm -rf /var/cache/apk/*
|
|
4633
4640
|
|
|
4634
4641
|
# Create unprivileged user
|