Files
s21_game2_front_dan/werf.yaml
2025-12-22 19:36:07 +03:00

110 lines
2.1 KiB
YAML

---
project: s21game2-frontend
configVersion: 1
build:
platform:
- linux/amd64
imageSpec:
author: s21party
config:
keepEssentialWerfLabels: true
---
image: frontend_base
platform:
- linux/amd64
from: registry.corp.s21party.ru/public-mirrors/node:25.2.1-alpine3.22
---
image: frontend_deps
platform:
- linux/amd64
from: frontend_base
git:
- add: /
to: /app
includePaths:
- package.json
- package-lock.json
stageDependencies:
install:
- package.json
- package-lock.json
shell:
beforeInstall:
- apk add --no-cache libc6-compat
install:
- cd /app
- |
if [ -f yarn.lock ]; then yarn --frozen-lockfile;
elif [ -f package-lock.json ]; then npm ci;
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile;
else echo "Lockfile not found." && exit 1;
fi
---
image: frontend_builder
platform:
- linux/amd64
from: frontend_base
imageSpec:
config:
workingDir: /app
env:
NEXT_TELEMETRY_DISABLED: "1"
git:
- add: /
to: /app
import:
- from: frontend_deps
before: install
add: /app/node_modules
to: /app/node_modules
shell:
install:
- cd /app
- |
if [ -f yarn.lock ]; then yarn run build;
elif [ -f package-lock.json ]; then npm run build;
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build;
else echo "Lockfile not found." && exit 1;
fi
---
image: frontend_runner
platform:
- linux/amd64
from: frontend_base
imageSpec:
config:
workingDir: /app
env:
NODE_ENV: "production"
PORT: "3000"
HOSTNAME: "0.0.0.0"
cmd: ["node", "server.js"]
user: nextjs
expose:
- "3000"
import:
- from: frontend_builder
before: setup
add: /app/.next/standalone
to: /app
owner: "1001"
group: "1001"
- from: frontend_builder
before: setup
add: /app/.next/static
to: /app/.next/static
owner: "1001"
group: "1001"
- from: frontend_builder
before: setup
add: /app/public
to: /app/public
shell:
beforeSetup:
- addgroup --system --gid 1001 nodejs
- adduser --system --uid 1001 nextjs