-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (30 loc) · 1.19 KB
/
Dockerfile
File metadata and controls
41 lines (30 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Copyright The Linux Foundation and each contributor to LFX.
# SPDX-License-Identifier: MIT
# Build stage
FROM node:22-alpine AS builder
# Set build environment
ARG BUILD_ENV=production
ARG APP_VERSION=development
ENV APP_VERSION=${APP_VERSION}
# Enable Corepack for Yarn
RUN corepack enable
WORKDIR /app
# Copy package files ONLY for dependency installation (for better layer caching)
COPY package.json yarn.lock turbo.json .yarnrc.yml ./
COPY .yarn .yarn
COPY apps/lfx-one/package.json ./apps/lfx-one/
COPY packages/shared/package.json ./packages/shared/
# Install dependencies (this layer is cached when deps don't change)
RUN yarn install --immutable
# NOW copy source code (changes here won't invalidate the dependency layer)
COPY . .
# Build shared package first
RUN yarn workspace @lfx-one/shared build:${BUILD_ENV}
# Build the Angular application
# Note: Client IDs (LaunchDarkly, DataDog RUM) are now injected at runtime
# via environment variables (LD_CLIENT_ID, DD_RUM_CLIENT_ID, DD_RUM_APPLICATION_ID)
RUN yarn workspace lfx-one-ui build:${BUILD_ENV}
# Expose port 4000
EXPOSE 4000
# Start the SSR server directly from built artifacts
CMD ["yarn", "workspace", "lfx-one-ui", "start:server"]