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
7 changes: 2 additions & 5 deletions templates/django/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN poetry config virtualenvs.create false && poetry install --only main --no-ro
{{ else }}
RUN pip install --no-cache-dir pipenv
COPY Pipfile Pipfile.lock* ./
RUN pipenv install --system --deploy && pip install --no-cache-dir {{ .wsgi_server }}
RUN pipenv install --system && pip install --no-cache-dir {{ .wsgi_server }}
{{ end }}

FROM python:{{ .python_version }}-slim
Expand All @@ -21,11 +21,8 @@ WORKDIR /app

{{ if eq .dependency_manager "pip" }}
COPY --from=builder /root/.local /usr/local
{{ else if eq .dependency_manager "poetry" }}
COPY --from=builder /usr/local/lib/python{{ .python_version }}/site-packages /usr/local/lib/python{{ .python_version }}/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
{{ else }}
COPY --from=builder /usr/local/lib/python{{ .python_version }}/site-packages /usr/local/lib/python{{ .python_version }}/site-packages
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /usr/local/bin /usr/local/bin
{{ end }}

Expand Down
16 changes: 8 additions & 8 deletions templates/expressjs/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ WORKDIR /app
{{ if eq .package_manager "npm" }}
COPY package*.json ./
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock ./
COPY package.json yarn.lock* ./
{{ else }}
COPY package.json pnpm-lock.yaml ./
COPY package.json pnpm-lock.yaml* ./
Comment on lines 5 to +10

Choose a reason for hiding this comment

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

P1 Badge Make yarn/pnpm lockfiles truly optional

COPY package.json yarn.lock* ./ still fails when yarn.lock is absent because Docker requires every COPY source to resolve to at least one file; an unmatched glob raises no source files were specified. As a result, Yarn (and pnpm) templates will continue to fail to build when no lockfile is supplied despite relaxing the install commands. Consider splitting the copy into two commands or using a pattern that always matches (e.g. package*.json) so lockfiles are genuinely optional across all affected templates (Express, NestJS, React, Next.js, Vue).

Useful? React with 👍 / 👎.

RUN npm install -g pnpm
{{ end }}

{{ if eq .node_env "production" }}
{{ if eq .package_manager "npm" }}
RUN npm ci --only=production
RUN npm install --only=production --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
RUN yarn install --production --frozen-lockfile
RUN yarn install --production
{{ else }}
RUN pnpm install --prod --frozen-lockfile
RUN pnpm install --prod
{{ end }}
{{ else }}
{{ if eq .package_manager "npm" }}
RUN npm ci
RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
RUN yarn install --frozen-lockfile
RUN yarn install
{{ else }}
RUN pnpm install --frozen-lockfile
RUN pnpm install
{{ end }}
{{ end }}

Expand Down
7 changes: 2 additions & 5 deletions templates/fastapi/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN poetry config virtualenvs.create false && poetry install --only main --no-ro
{{ else }}
RUN pip install --no-cache-dir pipenv
COPY Pipfile Pipfile.lock* ./
RUN pipenv install --system --deploy && pip install --no-cache-dir {{ .asgi_server }}
RUN pipenv install --system && pip install --no-cache-dir {{ .asgi_server }}
{{ end }}

FROM python:{{ .python_version }}-slim
Expand All @@ -24,11 +24,8 @@ RUN addgroup --system --gid 1001 app && \

{{ if eq .dependency_manager "pip" }}
COPY --from=builder /root/.local /usr/local
{{ else if eq .dependency_manager "poetry" }}
COPY --from=builder /usr/local/lib/python{{ .python_version }}/site-packages /usr/local/lib/python{{ .python_version }}/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
{{ else }}
COPY --from=builder /usr/local/lib/python{{ .python_version }}/site-packages /usr/local/lib/python{{ .python_version }}/site-packages
COPY --from=builder /usr/local/lib /usr/local/lib
COPY --from=builder /usr/local/bin /usr/local/bin
{{ end }}

Expand Down
2 changes: 1 addition & 1 deletion templates/flask/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN poetry config virtualenvs.create false && poetry install --only main --no-ro
{{ else }}
RUN pip install --no-cache-dir pipenv
COPY Pipfile Pipfile.lock* ./
RUN pipenv install --system --deploy && pip install --no-cache-dir {{ .wsgi_server }}
RUN pipenv install --system && pip install --no-cache-dir {{ .wsgi_server }}
{{ end }}

COPY . .
Expand Down
4 changes: 2 additions & 2 deletions templates/kotlin-spring-boot/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ FROM gradle:{{ .gradle_version }}-jdk{{ .java_version }}-alpine AS build

WORKDIR /app

COPY build.gradle.kts settings.gradle.kts ./
COPY build.gradle.kts settings.gradle.kts* ./

RUN gradle dependencies --no-daemon

COPY src ./src

RUN gradle clean build -x test --no-daemon

RUN cp build/libs/*[!n].jar app.jar
RUN cp $(find build/libs -name "*[!n].jar" -type f | head -n 1) app.jar 2>/dev/null || cp build/libs/*.jar app.jar

FROM eclipse-temurin:{{ .java_version }}-jre-alpine

Expand Down
10 changes: 5 additions & 5 deletions templates/mongodb/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,39 @@
},
{
"default": "",
"label": "데이터베이스명 (선택사항)",
"label": "데이터베이스명",
"name": "database_name",
"options": [],
"type": "text",
"category": "optional"
},
{
"default": "",
"label": "Root 사용자명 (선택사항)",
"label": "Root 사용자명",
"name": "root_username",
"options": [],
"type": "text",
"category": "optional"
},
{
"default": "",
"label": "Root 비밀번호 (선택사항)",
"label": "Root 비밀번호",
"name": "root_password",
"options": [],
"type": "password",
"category": "optional"
},
{
"default": "",
"label": "애플리케이션 사용자명 (선택사항)",
"label": "애플리케이션 사용자명",
"name": "user_username",
"options": [],
"type": "text",
"category": "optional"
},
{
"default": "",
"label": "애플리케이션 비밀번호 (선택사항)",
"label": "애플리케이션 비밀번호",
"name": "user_password",
"options": [],
"type": "password",
Expand Down
20 changes: 10 additions & 10 deletions templates/mysql/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,32 +41,32 @@
"category": "required"
},
{
"default": "myapp",
"label": "데이터베이스명",
"name": "database_name",
"default": "",
"label": "Root 비밀번호",
"name": "root_password",
"options": [],
"type": "text",
"category": "optional"
"type": "password",
"category": "required"
},
{
"default": "",
"label": "Root 비밀번호 (선택사항)",
"name": "root_password",
"label": "데이터베이스명",
"name": "database_name",
"options": [],
"type": "password",
"type": "text",
"category": "optional"
},
{
"default": "",
"label": "애플리케이션 사용자명 (선택사항)",
"label": "애플리케이션 사용자명",
"name": "user_username",
"options": [],
"type": "text",
"category": "optional"
},
{
"default": "",
"label": "애플리케이션 비밀번호 (선택사항)",
"label": "애플리케이션 비밀번호",
"name": "user_password",
"options": [],
"type": "password",
Expand Down
20 changes: 10 additions & 10 deletions templates/nestjs/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ WORKDIR /app

{{ if eq .package_manager "npm" }}
COPY package*.json ./
RUN npm ci
RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ end }}

COPY . .
Expand All @@ -29,13 +29,13 @@ WORKDIR /app

{{ if eq .package_manager "npm" }}
COPY package*.json ./
RUN npm ci --only=production
RUN npm install --only=production --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock ./
RUN yarn install --production --frozen-lockfile
COPY package.json yarn.lock* ./
RUN yarn install --production
{{ else }}
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --prod --frozen-lockfile
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install --prod
{{ end }}

COPY --from=builder /app/dist ./dist
Expand Down
12 changes: 7 additions & 5 deletions templates/nextjs/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ WORKDIR /app

{{ if eq .package_manager "npm" }}
COPY package*.json ./
RUN npm ci
RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ end }}

FROM node:{{ .node_version }}-alpine AS builder
Expand All @@ -24,6 +24,8 @@ RUN npm install -g pnpm
COPY --from=deps /app/node_modules ./node_modules
COPY . .

RUN mkdir -p public

{{ if eq .package_manager "npm" }}
RUN npm run build
{{ else if eq .package_manager "yarn" }}
Expand Down
22 changes: 11 additions & 11 deletions templates/postgresql/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@
"category": "required"
},
{
"default": "myapp",
"default": "",
"label": "PostgreSQL Root 비밀번호",
"name": "postgres_password",
"options": [],
"type": "password",
"category": "required"
},
{
"default": "",
"label": "데이터베이스명",
"name": "database_name",
"options": [],
Expand All @@ -43,28 +51,20 @@
},
{
"default": "",
"label": "사용자명 (선택사항)",
"label": "사용자명",
"name": "user_username",
"options": [],
"type": "text",
"category": "optional"
},
{
"default": "",
"label": "비밀번호 (선택사항)",
"label": "비밀번호",
"name": "user_password",
"options": [],
"type": "password",
"category": "optional"
},
{
"default": "",
"label": "PostgreSQL Root 비밀번호 (선택사항)",
"name": "postgres_password",
"options": [],
"type": "password",
"category": "optional"
},
{
"default": "100",
"label": "최대 연결 수",
Expand Down
4 changes: 2 additions & 2 deletions templates/postgresql/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ ENV POSTGRES_PASSWORD={{ .postgres_password }}
{{- else -}}
ENV POSTGRES_HOST_AUTH_METHOD=trust
{{- end }}
ENV POSTGRES_MAX_CONNECTIONS={{ .max_connections }}
ENV POSTGRES_SHARED_BUFFERS={{ .shared_buffers }}
ENV POSTGRES_MAX_CONNECTIONS={{ if .max_connections }}{{ .max_connections }}{{ else }}100{{ end }}
ENV POSTGRES_SHARED_BUFFERS={{ if .shared_buffers }}{{ .shared_buffers }}{{ else }}128MB{{ end }}

RUN echo "max_connections = $POSTGRES_MAX_CONNECTIONS" >> /usr/share/postgresql/postgresql.conf.sample && \
echo "shared_buffers = $POSTGRES_SHARED_BUFFERS" >> /usr/share/postgresql/postgresql.conf.sample{{ if .effective_cache_size }} && \
Expand Down
10 changes: 5 additions & 5 deletions templates/react/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ WORKDIR /app

{{ if eq .package_manager "npm" }}
COPY package*.json ./
RUN npm ci
RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ end }}

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion templates/redis/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
{
"default": "",
"label": "Redis 비밀번호 (선택사항)",
"label": "Redis 비밀번호",
"name": "redis_password",
"options": [],
"type": "password",
Expand Down
4 changes: 2 additions & 2 deletions templates/spring-boot/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ COPY src ./src
RUN mvn clean package -DskipTests
RUN cp target/*.jar app.jar
{{ else }}
COPY build.gradle.kts settings.gradle.kts ./
COPY build.gradle.kts settings.gradle.kts* ./
RUN gradle dependencies --no-daemon
COPY src ./src
RUN gradle clean build -x test --no-daemon
RUN cp build/libs/*[!n].jar app.jar
RUN cp $(find build/libs -name "*[!n].jar" -type f | head -n 1) app.jar 2>/dev/null || cp build/libs/*.jar app.jar
{{ end }}

FROM eclipse-temurin:{{ .java_version }}-jre-alpine
Expand Down
10 changes: 5 additions & 5 deletions templates/vuejs/template.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ WORKDIR /app

{{ if eq .package_manager "npm" }}
COPY package*.json ./
RUN npm ci
RUN npm install --no-audit --prefer-offline
{{ else if eq .package_manager "yarn" }}
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile
COPY package.json yarn.lock* ./
RUN yarn install
{{ else }}
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml* ./
RUN npm install -g pnpm && pnpm install
{{ end }}

COPY . .
Expand Down