This commit is contained in:
2026-08-24 21:17:56 +02:00
parent 3ac43cd014
commit 7bc0aea1b3
4 changed files with 25 additions and 109 deletions
+9 -3
View File
@@ -5,6 +5,14 @@ FROM base AS install
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# Runtime deps only: build/ already inlines svelte, kit, drizzle-orm & co, so the
# devDependencies were ~640MB of dead weight per arch. drizzle-kit and its libsql
# driver are the exception — `db:migrate` runs them at startup.
FROM base AS runtime-deps
COPY package.json bun.lock ./
RUN bun install --production --frozen-lockfile \
&& bun add --no-save drizzle-kit@1.0.0-beta.22 @libsql/client@0.17.3
FROM base AS build
ENV NODE_ENV=production
COPY --from=install /app/node_modules node_modules
@@ -31,15 +39,13 @@ ENV NODE_ENV=production \
PORT=3000 \
ORIGIN=http://localhost:3000 \
REPOSITORY_URL=https://tea.urania.dev/api/v1/repos/urania/nadir-agent/releases/latest
# full node_modules: drizzle-kit (devDep) is needed for `drizzle-kit migrate` at startup
WORKDIR /app
COPY --from=install /app/node_modules node_modules
COPY --from=runtime-deps /app/node_modules node_modules
COPY --from=build /app/build build
COPY --from=build /app/config config
COPY drizzle drizzle
COPY drizzle.config.ts package.json ./
RUN mkdir -p /app/data
COPY drizzle.config.ts package.json ./
RUN bun run db:migrate
VOLUME /app/data
EXPOSE 3000