35 lines
659 B
Docker
35 lines
659 B
Docker
# Stage 1: Build
|
|
FROM oven/bun:latest AS builder
|
|
WORKDIR /app
|
|
|
|
# Copy dependency files and install
|
|
COPY package.json bun.lockb* ./
|
|
RUN bun install
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
|
|
ARG OLLAMA_URL
|
|
|
|
ENV OLLAMA_URL=$OLLAMA_URL
|
|
|
|
# Build with the Bun Nitro preset
|
|
RUN NITRO_PRESET=bun bun run build
|
|
|
|
# Stage 2: Production
|
|
FROM oven/bun:latest
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
# Copy only the built output from the builder stage
|
|
COPY --from=builder /app/.output ./.output
|
|
|
|
# Tell Nuxt to bind to all network interfaces inside the container
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=3000
|
|
|
|
EXPOSE 3000
|
|
|
|
# Execute the server entrypoint
|
|
CMD ["bun", "run", ".output/server/index.mjs"]
|