Dockerfile47 lines · 1327 chars 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
# 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"]