deepseek harness
This commit is contained in:
1 parent
cbdcf74bfc
commit
7961a3d2a6
173 files changed
+9718
-7652
No files matched your search
+15
-43
@@ -1,62 +1,34 @@
|
||||
FROM node:22-alpine AS base
|
||||
|
||||
# Stage 1: Install dependencies
|
||||
FROM base AS deps
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
# ── Mozimo — TanStack Start (Vite) ──────────────────────────
|
||||
FROM node:lts-trixie-alpine AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies based on the preferred package manager
|
||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
|
||||
COPY package.json yarn.lock* package-lock.json* ./
|
||||
RUN \
|
||||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||
elif [ -f package-lock.json ]; then npm ci; \
|
||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
# Stage 2: Rebuild the source code only when needed
|
||||
FROM base AS builder
|
||||
FROM node:lts-trixie-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Environment variables needed during build time
|
||||
ARG INSTAGRAM_ACCESS_TOKEN
|
||||
ENV INSTAGRAM_ACCESS_TOKEN=$INSTAGRAM_ACCESS_TOKEN
|
||||
|
||||
RUN \
|
||||
if [ -f yarn.lock ]; then yarn build; \
|
||||
if [ -f yarn.lock ]; then yarn run build; \
|
||||
elif [ -f package-lock.json ]; then npm run build; \
|
||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
|
||||
else npm run build; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
|
||||
|
||||
# Stage 3: Production image, copy all the files and run nitro
|
||||
FROM base AS runner
|
||||
FROM node:lts-trixie-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
# Set host to 0.0.0.0 to ensure it's accessible outside the container
|
||||
ENV HOST=0.0.0.0
|
||||
ENV PORT=3000
|
||||
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nitrojs
|
||||
|
||||
# Copy the build output from the builder stage
|
||||
# TanStack Start/Nitro builds into the .output directory
|
||||
COPY --from=builder --chown=nitrojs:nodejs /app/.output ./.output
|
||||
|
||||
USER nitrojs
|
||||
|
||||
ENV HOST=0.0.0.0
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
COPY --from=builder /app/vite.config.ts ./vite.config.ts
|
||||
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
||||
EXPOSE 3000
|
||||
|
||||
# Health check to ensure the server is responding
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1
|
||||
|
||||
# server.mjs is created by nitro build
|
||||
CMD ["node", ".output/server/index.mjs"]
|
||||
CMD ["npm", "start"]
|
||||
Reference in new issue
Block a user