FROM node:24-slim AS daytona
ENV CI=true
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g corepack && corepack enable
WORKDIR /daytona
# Yarn caching layer (immutable install)
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install --immutable
# Nx + TS config
COPY nx.json tsconfig.base.json ./
# App source
COPY apps/api/ apps/api/
COPY apps/dashboard/ apps/dashboard/
# Lib dependencies
COPY libs/runner-api-client/ libs/runner-api-client/
COPY libs/api-client/ libs/api-client/
COPY libs/analytics-api-client/ libs/analytics-api-client/
COPY libs/toolbox-api-client/ libs/toolbox-api-client/
COPY libs/sdk-typescript/ libs/sdk-typescript/
ENV NX_DAEMON=false
RUN yarn nx build api --configuration=production --nxBail=true
RUN VITE_BASE_API_URL=%DAYTONA_BASE_API_URL% yarn nx build dashboard --configuration=production --nxBail=true --output-style=stream
ARG VERSION=0.0.1
ENV VERSION=${VERSION}
EXPOSE 3000
HEALTHCHECK CMD ["curl", "-f", "http://localhost:3000/api/config"]
ENTRYPOINT ["node", "dist/apps/api/main.js"]
# Ignore git and node_modules .git node_modules/ **/node_modules/ # Build outputs dist/ **/dist/ build/ **/build/ # Logs and caches *.log logs/ *.tsbuildinfo .vscode/ .env .env.local .env.* # OS files .DS_Store # Tooling coverage/ .coverage/ .nyc_output/ .npm/ .yarn/ .cache/ .husky/ # IDEs and editors .idea/ *.swp *.swo
Concerns: Dashboard build line uses VITE_BASE_API_URL=%DAYTONA_BASE_API_URL% which uses Windows-style variable syntax and won't expand in Linux shell; this may cause build-time config to be literal rather than the intended value.
Smoke [FAIL]: curl -f http://localhost:3000/api/config
Output: % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to localhost port 3000 after 0 ms: Couldn't connect to server
Smoke [PASS]: test -f dist/apps/api/main.jsFROM node:24-slim AS daytona
ENV CI=true
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g corepack && corepack enable
WORKDIR /daytona
# Yarn caching layer (immutable install)
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install --immutable
# Nx + TS config
COPY nx.json tsconfig.base.json ./
# App source
COPY apps/api/ apps/api/
COPY apps/dashboard/ apps/dashboard/
# Lib dependencies
COPY libs/runner-api-client/ libs/runner-api-client/
COPY libs/api-client/ libs/api-client/
COPY libs/analytics-api-client/ libs/analytics-api-client/
COPY libs/toolbox-api-client/ libs/toolbox-api-client/
COPY libs/sdk-typescript/ libs/sdk-typescript/
ENV NX_DAEMON=false
# Build API
RUN yarn nx build api --configuration=production --nxBail=true
# Build Dashboard with base URL injection (Linux-friendly)
ARG DAYTONA_BASE_API_URL
ENV DAYTONA_BASE_API_URL=${DAYTONA_BASE_API_URL}
RUN VITE_BASE_API_URL=${DAYTONA_BASE_API_URL} yarn nx build dashboard --configuration=production --nxBail=true --output-style=stream
ARG VERSION=0.0.1
ENV VERSION=${VERSION}
EXPOSE 3000
HEALTHCHECK CMD ["curl", "-f", "http://localhost:3000/api/config"]
ENTRYPOINT ["node", "dist/apps/api/main.js"]
Concerns: DAYTONA_BASE_API_URL is an ARG with no default; if not provided at build time, the dashboard build may be injected with an empty base URL. Consider a default or add validation., ENTRYPOINT assumes the API is built to dist/apps/api/main.js; if NX output path changes, the image may fail to start. Confirm the build outputs match this path.
Smoke [FAIL]: curl -f http://localhost:3000/api/config
Output: % Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to localhost port 3000 after 0 ms: Couldn't connect to server
Smoke [PASS]: test -f dist/apps/api/main.jsFROM node:24-slim AS daytona
ENV CI=true
# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g corepack && corepack enable
WORKDIR /daytona
# Yarn caching layer (immutable install)
COPY package.json yarn.lock .yarnrc.yml ./
RUN yarn install --immutable
# Nx + TS config
COPY nx.json tsconfig.base.json ./
# App source
COPY apps/api/ apps/api/
COPY apps/dashboard/ apps/dashboard/
# Lib dependencies
COPY libs/runner-api-client/ libs/runner-api-client/
COPY libs/api-client/ libs/api-client/
COPY libs/analytics-api-client/ libs/analytics-api-client/
COPY libs/toolbox-api-client/ libs/toolbox-api-client/
COPY libs/sdk-typescript/ libs/sdk-typescript/
ENV NX_DAEMON=false
# Build API
RUN yarn nx build api --configuration=production --nxBail=true
# Build Dashboard with base URL injection (Linux-friendly)
ARG DAYTONA_BASE_API_URL=http://localhost:3000
ENV DAYTONA_BASE_API_URL=${DAYTONA_BASE_API_URL}
RUN VITE_BASE_API_URL=${DAYTONA_BASE_API_URL} yarn nx build dashboard --configuration=production --nxBail=true --output-style=stream
ARG VERSION=0.0.1
ENV VERSION=${VERSION}
EXPOSE 3000
HEALTHCHECK CMD ["curl", "-f", "http://localhost:3000/api/config"]
ENTRYPOINT ["node", "dist/apps/api/main.js"]
Smoke [PASS]: node dist/apps/api/main.js & PID=$!; sleep 2; curl -fsS http://localhost:3000/api/config; kill $PID