create-ereo 0.1.31 → 0.1.32

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -25
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -95,27 +95,21 @@ function parseArgs(args) {
95
95
  }
96
96
  return { projectName, options };
97
97
  }
98
- function generateDockerfile(typescript) {
99
- const tsconfigCopy = typescript ? `COPY --from=builder --chown=ereo:ereo /app/tsconfig.json ./
100
- ` : "";
101
- return `# syntax=docker/dockerfile:1
102
-
103
- # ---- Stage 1: Install production dependencies ----
104
- FROM oven/bun:1-slim AS deps
105
- WORKDIR /app
106
- COPY package.json bun.lockb* ./
107
- RUN --mount=type=cache,target=/root/.bun/install/cache \\
108
- bun install --frozen-lockfile --production --ignore-scripts
109
-
110
- # ---- Stage 2: Install all deps + build ----
98
+ function generateDockerfile(_typescript) {
99
+ return `# ---- Stage 1: Install all deps + build ----
111
100
  FROM oven/bun:1-slim AS builder
112
101
  WORKDIR /app
113
102
  COPY package.json bun.lockb* ./
114
- RUN --mount=type=cache,target=/root/.bun/install/cache \\
115
- bun install --frozen-lockfile --ignore-scripts
103
+ RUN bun install --ignore-scripts
116
104
  COPY . .
117
105
  RUN bun run build
118
106
 
107
+ # ---- Stage 2: Production dependencies only ----
108
+ FROM oven/bun:1-slim AS deps
109
+ WORKDIR /app
110
+ COPY package.json bun.lockb* ./
111
+ RUN bun install --production --ignore-scripts
112
+
119
113
  # ---- Stage 3: Production image ----
120
114
  FROM oven/bun:1-slim AS runner
121
115
  WORKDIR /app
@@ -126,21 +120,21 @@ ENV NODE_ENV=production
126
120
  RUN groupadd --system --gid 1001 ereo && \\
127
121
  useradd --system --uid 1001 --gid ereo --no-create-home ereo
128
122
 
129
- # Copy only what's needed to run
130
- COPY --from=deps --chown=ereo:ereo /app/node_modules ./node_modules
131
- COPY --from=builder --chown=ereo:ereo /app/.ereo ./.ereo
132
- COPY --from=builder --chown=ereo:ereo /app/package.json ./
133
- COPY --from=builder --chown=ereo:ereo /app/ereo.config.* ./
134
- ${tsconfigCopy}COPY --from=builder --chown=ereo:ereo /app/app ./app
135
- COPY --from=builder --chown=ereo:ereo /app/public ./public
123
+ # Copy production node_modules
124
+ COPY --from=deps --chown=ereo:ereo /app/node_modules ./node_modules
125
+
126
+ # Copy build output and runtime files
127
+ COPY --from=builder --chown=ereo:ereo /app/.ereo ./.ereo
128
+ COPY --from=builder --chown=ereo:ereo /app/app ./app
129
+ COPY --from=builder --chown=ereo:ereo /app/public ./public
130
+ COPY --from=builder --chown=ereo:ereo /app/package.json ./
131
+ COPY --from=builder --chown=ereo:ereo /app/ereo.config.* ./
132
+ COPY --from=builder --chown=ereo:ereo /app/tsconfig.* ./
136
133
 
137
134
  USER ereo
138
135
 
139
136
  EXPOSE 3000
140
137
 
141
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \\
142
- CMD bun -e "fetch('http://localhost:3000').then(r=>{if(!r.ok)throw 1}).catch(()=>process.exit(1))"
143
-
144
138
  CMD ["bun", "run", "start"]
145
139
  `;
146
140
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ereo",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "license": "MIT",
5
5
  "author": "Ereo Team",
6
6
  "homepage": "https://ereo.dev",