sozsoft-platform/ui/Sozsoft.Platform.Ui.Dockerfile
2026-08-13 14:34:43 +03:00

39 lines
1.7 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

ARG ENV="dev"
FROM node:24-alpine
ARG ENV=$ENV
RUN apk add --no-cache ca-certificates && update-ca-certificates
ENV GENERATE_SOURCEMAP=false
ENV NODE_OPTIONS=--max-old-space-size=16384
WORKDIR /app
COPY package.json package-lock.json ./
# Vite 8 rolldown ile bundle ediyor; workbox-build hâlâ rollup çekiyor.
# Alpine (musl) native binding'leri lockfile'da optional olduğu için ikisi de elle kuruluyor.
RUN npm i && \
npm install @rolldown/binding-linux-x64-musl @rollup/rollup-linux-x64-musl --save-dev && \
npm rebuild rollup
COPY . .
# DevExtreme lisansı yalnızca build sırasında gerekli: prebuild:production adımı
# devextreme-license CLI'ı çalıştırıp src/devextreme-license.ts dosyasını üretiyor.
# CLI anahtarı sırasıyla DevExpress_License env'inden veya
# $HOME/.config/DevExpress/DevExpress_License.txt dosyasından okur; anahtar
# bulunamazsa TRIAL key üretir ve uygulamada değerlendirme sürümü uyarısı çıkar.
#
# GÜVENLİK: Gizli olan LCX ana anahtarıdır; imaj katmanında kalmaması için
# dosya yazma, build ve silme tek RUN içinde yapılıyor. ENV olarak da
# tanımlanmıyor, aksi halde `docker inspect` ile okunabilir hale gelirdi.
# Bundle'a gömülen LCP anahtarı ise türetilmiş, istemci tarafı anahtardır.
ARG DevExpress_License
RUN if [ -n "$DevExpress_License" ]; then \
mkdir -p "$HOME/.config/DevExpress" && \
printf '%s\n' "$DevExpress_License" > "$HOME/.config/DevExpress/DevExpress_License.txt"; \
else \
echo "UYARI: DevExpress_License boş. DevExtreme TRIAL anahtarıyla derleniyor."; \
fi; \
npm run build:production -- --mode $ENV; \
status=$?; \
rm -rf "$HOME/.config/DevExpress"; \
exit $status
CMD ["npm", "run", "preview"]