Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ tmp/
# Generated migration files (local testing)
/migrations/
*.sql
scripts/.cache/
1 change: 1 addition & 0 deletions templates/django/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"options": [
"pip",
"poetry",
"uv",
"pipenv"
],
"type": "select",
Expand Down
5 changes: 5 additions & 0 deletions templates/django/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ RUN pip install --no-cache-dir --user -r requirements.txt {{ .wsgi_server }}
RUN pip install --no-cache-dir poetry
COPY pyproject.toml poetry.lock* ./
RUN poetry config virtualenvs.create false && poetry install --only main --no-root && pip install --no-cache-dir {{ .wsgi_server }}
{{ else if eq .dependency_manager "uv" }}
RUN pip install --no-cache-dir uv
COPY pyproject.toml uv.lock* ./
RUN uv pip install --system --no-cache-dir . && \
uv pip install --system --no-cache-dir {{ .wsgi_server }}
{{ else }}
RUN pip install --no-cache-dir pipenv
COPY Pipfile Pipfile.lock* ./
Expand Down
3 changes: 2 additions & 1 deletion templates/expressjs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"options": [
"npm",
"yarn",
"pnpm"
"pnpm",
"bun"
],
"type": "select",
"category": "required"
Expand Down
20 changes: 17 additions & 3 deletions templates/expressjs/template.tmpl
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine
{{ else }}
FROM node:{{ .node_version }}-alpine
{{ end }}

WORKDIR /app

{{ if eq .package_manager "npm" }}
COPY package*.json ./
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock* ./
{{ else }}
{{ else if eq .package_manager "pnpm" }}
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm
{{ else }}
COPY package.json bun.lockb* ./
{{ end }}

{{ if eq .build_mode "production" }}
{{ if eq .package_manager "npm" }}
RUN npm install --only=production --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
RUN yarn install --production
{{ else }}
{{ else if eq .package_manager "pnpm" }}
RUN pnpm install --prod
{{ else }}
RUN bun install --production
{{ end }}
{{ else }}
{{ if eq .package_manager "npm" }}
RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
RUN yarn install
{{ else }}
{{ else if eq .package_manager "pnpm" }}
RUN pnpm install
{{ else }}
RUN bun install
{{ end }}
{{ end }}

Expand All @@ -46,5 +56,9 @@ CMD ["pm2-runtime", "start", "{{ .entry_file }}", "--name", "express-app"]
{{ else if eq .process_manager "nodemon" }}
CMD ["nodemon", "{{ .entry_file }}"]
{{ else }}
{{ if eq .package_manager "bun" }}
CMD ["bun", "run", "{{ .entry_file }}"]
{{ else }}
CMD ["node", "{{ .entry_file }}"]
{{ end }}
{{ end }}
1 change: 1 addition & 0 deletions templates/fastapi/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"options": [
"pip",
"poetry",
"uv",
"pipenv"
],
"type": "select",
Expand Down
5 changes: 5 additions & 0 deletions templates/fastapi/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ RUN pip install --no-cache-dir --user -r requirements.txt {{ .asgi_server }}
RUN pip install --no-cache-dir poetry
COPY pyproject.toml poetry.lock* ./
RUN poetry config virtualenvs.create false && poetry install --only main --no-root && pip install --no-cache-dir {{ .asgi_server }}
{{ else if eq .dependency_manager "uv" }}
RUN pip install --no-cache-dir uv
COPY pyproject.toml uv.lock* ./
RUN uv pip install --system --no-cache-dir . && \
uv pip install --system --no-cache-dir {{ .asgi_server }}
{{ else }}
RUN pip install --no-cache-dir pipenv
COPY Pipfile Pipfile.lock* ./
Expand Down
1 change: 1 addition & 0 deletions templates/flask/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"options": [
"pip",
"poetry",
"uv",
"pipenv"
],
"type": "select",
Expand Down
5 changes: 5 additions & 0 deletions templates/flask/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ RUN pip install --no-cache-dir -r requirements.txt {{ .wsgi_server }}
RUN pip install --no-cache-dir poetry
COPY pyproject.toml poetry.lock* ./
RUN poetry config virtualenvs.create false && poetry install --only main --no-root && pip install --no-cache-dir {{ .wsgi_server }}
{{ else if eq .dependency_manager "uv" }}
RUN pip install --no-cache-dir uv
COPY pyproject.toml uv.lock* ./
RUN uv pip install --system --no-cache-dir . && \
uv pip install --system --no-cache-dir {{ .wsgi_server }}
{{ else }}
RUN pip install --no-cache-dir pipenv
COPY Pipfile Pipfile.lock* ./
Expand Down
3 changes: 2 additions & 1 deletion templates/nestjs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"options": [
"npm",
"yarn",
"pnpm"
"pnpm",
"bun"
],
"type": "select",
"category": "required"
Expand Down
28 changes: 24 additions & 4 deletions templates/nestjs/template.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine AS builder
{{ else }}
FROM node:{{ .node_version }}-alpine AS builder
{{ end }}

WORKDIR /app

Expand All @@ -8,9 +12,12 @@ RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
{{ else if eq .package_manager "pnpm" }}
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ else }}
COPY package.json bun.lockb* ./
RUN bun install
{{ end }}

COPY . .
Expand All @@ -19,11 +26,17 @@ COPY . .
RUN npm run build
{{ else if eq .package_manager "yarn" }}
RUN yarn build
{{ else }}
{{ else if eq .package_manager "pnpm" }}
RUN pnpm build
{{ else }}
RUN bun run build
{{ end }}

{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine
{{ else }}
FROM node:{{ .node_version }}-alpine
{{ end }}

WORKDIR /app

Expand All @@ -33,13 +46,20 @@ RUN npm install --only=production --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock* ./
RUN yarn install --production
{{ else }}
{{ else if eq .package_manager "pnpm" }}
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install --prod
{{ else }}
COPY package.json bun.lockb* ./
RUN bun install --production
{{ end }}

COPY --from=builder /app/dist ./dist

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Run NestJS Bun image with bun, not node

The new NestJS option uses oven/bun for both the build and runtime stages, but the startup command is still CMD ["node", "dist/main"]. The bun image does not ship with the Node binary, so containers generated with package_manager = "bun" will exit immediately with node: not found. When bun is selected the command should invoke bun (e.g. bun run start or similar) instead of Node.

Useful? React with 👍 / 👎.


EXPOSE 3000

CMD ["node", "dist/main"]
{{ if eq .package_manager "bun" }}
CMD ["bun", "run", "dist/main"]
{{ else }}
CMD ["node", "dist/main"]
{{ end }}
3 changes: 2 additions & 1 deletion templates/nextjs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
"options": [
"npm",
"yarn",
"pnpm"
"pnpm",
"bun"
],
"type": "select",
"category": "required"
Expand Down
27 changes: 23 additions & 4 deletions templates/nextjs/template.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine AS deps
{{ else }}
FROM node:{{ .node_version }}-alpine AS deps
{{ end }}

WORKDIR /app

Expand All @@ -8,12 +12,19 @@ RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
{{ else if eq .package_manager "pnpm" }}
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ else }}
COPY package.json bun.lockb* ./
RUN bun install
{{ end }}

{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine AS builder
{{ else }}
FROM node:{{ .node_version }}-alpine AS builder
{{ end }}

WORKDIR /app

Expand All @@ -30,11 +41,17 @@ RUN mkdir -p public
RUN npm run build
{{ else if eq .package_manager "yarn" }}
RUN yarn build
{{ else }}
{{ else if eq .package_manager "pnpm" }}
RUN pnpm build
{{ else }}
RUN bun run build
{{ end }}

{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine AS runner
{{ else }}
FROM node:{{ .node_version }}-alpine AS runner
{{ end }}

WORKDIR /app

Expand All @@ -50,7 +67,7 @@ RUN npm install -g pnpm
COPY --from=deps /app/node_modules ./node_modules
COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder --chown=nextjs:nodejs /app/package.json ./package.json

USER nextjs

Expand All @@ -60,6 +77,8 @@ EXPOSE 3000
CMD ["npm", "start"]
{{ else if eq .package_manager "yarn" }}
CMD ["yarn", "start"]
{{ else }}
{{ else if eq .package_manager "pnpm" }}
CMD ["pnpm", "start"]
{{ else }}
CMD ["bun", "--bun", "run", "start"]
{{ end }}
3 changes: 2 additions & 1 deletion templates/react/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"options": [
"npm",
"yarn",
"pnpm"
"pnpm",
"bun"
],
"type": "select",
"category": "required"
Expand Down
13 changes: 11 additions & 2 deletions templates/react/template.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine AS builder
{{ else }}
FROM node:{{ .node_version }}-alpine AS builder
{{ end }}

WORKDIR /app

Expand All @@ -8,9 +12,12 @@ RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
{{ else if eq .package_manager "pnpm" }}
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ else }}
COPY package.json bun.lockb* ./
RUN bun install
{{ end }}

COPY . .
Expand All @@ -19,8 +26,10 @@ COPY . .
RUN npm run build
{{ else if eq .package_manager "yarn" }}
RUN yarn build
{{ else }}
{{ else if eq .package_manager "pnpm" }}
RUN pnpm build
{{ else }}
RUN bun run build
{{ end }}

FROM nginx:alpine
Expand Down
3 changes: 2 additions & 1 deletion templates/vuejs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"options": [
"npm",
"yarn",
"pnpm"
"pnpm",
"bun"
],
"type": "select",
"category": "required"
Expand Down
13 changes: 11 additions & 2 deletions templates/vuejs/template.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{ if eq .package_manager "bun" }}
FROM oven/bun:1-alpine AS builder
{{ else }}
FROM node:{{ .node_version }}-alpine AS builder
{{ end }}
WORKDIR /app

{{ if eq .package_manager "npm" }}
Expand All @@ -7,9 +11,12 @@ RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
{{ else if eq .package_manager "pnpm" }}
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ else }}
COPY package.json bun.lockb* ./
RUN bun install
{{ end }}

COPY . .
Expand All @@ -18,8 +25,10 @@ COPY . .
RUN npm run build
{{ else if eq .package_manager "yarn" }}
RUN yarn build
{{ else }}
{{ else if eq .package_manager "pnpm" }}
RUN pnpm build
{{ else }}
RUN bun run build
{{ end }}

FROM nginx:alpine
Expand Down
Loading