FROM node:lts AS daytona
ENV CI=true
# Install dependencies (apt instead of apk)
RUN apt-get update && apt-get install -y --no-install-recommends bash curl && \
rm -rf /var/lib/apt/lists/*
RUN npm install -g corepack && corepack enable
WORKDIR /daytona
# Yarn caching layer
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}
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:3000/api/config" ]
ENTRYPOINT ["node", "dist/apps/api/main.js"]
node_modules dist Dockerfile .dockerignore .git .github
Concerns: VITE_BASE_API_URL=%DAYTONA_BASE_API_URL% yarn nx build dashboard ... uses Windows-style %VAR% syntax which won't expand on Linux; should use $DAYTONA_BASE_API_URL (or an ARG) to properly pass the value., No EXPOSE instruction for port 3000; adding EXPOSE 3000 would make the container's runtime port explicit. Smoke [PASS]: test -f /daytona/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