deploy-stack 0.3.1 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deploy-stack",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Provision production-ready AWS infrastructure and CI/CD pipelines in seconds.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -85,7 +85,7 @@ export async function mainStack() {
85
85
  // 2.7 Set intelligent defaults
86
86
  let defaultPort = '3000';
87
87
 
88
- if (finalFramework === 'static') defaultPort = '80';
88
+ if (finalFramework === 'static') defaultPort = '8080';
89
89
  if (finalFramework === 'python') defaultPort = '8000';
90
90
 
91
91
  // 3. Prompt Configuration Group
@@ -25,7 +25,7 @@ export function getFrameworkWarning(frameworkId) {
25
25
  return (
26
26
  color.bgYellow(color.black(' ⚠️ IMPORTANT: STATIC SITE SETUP REQUIRED ')) +
27
27
  color.yellow('\n 1. Open your generated Dockerfile.') +
28
- color.yellow('\n 2. Ensure the build output folder on line 15 matches your framework:') +
28
+ color.yellow('\n 2. Ensure the "COPY --from=builder" command matches your framework:') +
29
29
  color.yellow('\n Vite / Astro: COPY --from=builder /app/dist /usr/share/nginx/html') +
30
30
  color.yellow('\n Create React App: COPY --from=builder /app/build /usr/share/nginx/html') +
31
31
  color.yellow('\n 3. Ensure your package.json has a "build" script (e.g., "vite build").\n\n')
@@ -1,5 +1,5 @@
1
1
  # Stage 1: Install dependencies and build the app
2
- FROM node:20-alpine AS builder
2
+ FROM node:22-alpine AS builder
3
3
  WORKDIR /app
4
4
 
5
5
  # Copy package files and install dependencies
@@ -14,7 +14,7 @@ COPY . .
14
14
  RUN npm run build
15
15
 
16
16
  # Stage 2: Production environment
17
- FROM node:20-alpine AS runner
17
+ FROM node:22-alpine AS runner
18
18
  WORKDIR /app
19
19
 
20
20
  ENV NODE_ENV=production
@@ -1,4 +1,4 @@
1
- FROM node:20-alpine
1
+ FROM node:22-alpine
2
2
 
3
3
  # 1. Set production environment (optimizes Node and prevents dev dependencies)
4
4
  ENV NODE_ENV=production
@@ -1,5 +1,5 @@
1
1
  # STAGE 1: Build the static assets
2
- FROM node:20-alpine AS builder
2
+ FROM node:22-alpine AS builder
3
3
  WORKDIR /app
4
4
 
5
5
  COPY package*.json ./
@@ -17,8 +17,17 @@ FROM nginx:alpine
17
17
  # Vite/Astro = dist | Create React App/Gatsby = build | Next.js Static = out
18
18
  COPY --from=builder /app/dist /usr/share/nginx/html
19
19
 
20
- # Dynamically update the Nginx port
21
- RUN sed -i "s/listen 80;/listen {{PORT}};/g" /etc/nginx/conf.d/default.conf
20
+ # Inject custom Nginx configuration for unprivileged ports and SPA routing
21
+ RUN echo "server {" > /etc/nginx/conf.d/default.conf && \
22
+ echo " listen {{PORT}};" >> /etc/nginx/conf.d/default.conf && \
23
+ echo " listen [::]:{{PORT}};" >> /etc/nginx/conf.d/default.conf && \
24
+ echo " server_name localhost;" >> /etc/nginx/conf.d/default.conf && \
25
+ echo " location / {" >> /etc/nginx/conf.d/default.conf && \
26
+ echo " root /usr/share/nginx/html;" >> /etc/nginx/conf.d/default.conf && \
27
+ echo " index index.html index.htm;" >> /etc/nginx/conf.d/default.conf && \
28
+ echo " try_files \$uri \$uri/ /index.html;" >> /etc/nginx/conf.d/default.conf && \
29
+ echo " }" >> /etc/nginx/conf.d/default.conf && \
30
+ echo "}" >> /etc/nginx/conf.d/default.conf
22
31
 
23
32
  # Silence unprivileged user directive warning in main config
24
33
  RUN sed -i 's/^user\s\+nginx;/# user nginx;/' /etc/nginx/nginx.conf