Files
thoughts/thoughts-frontend/Dockerfile
Gabriel Kaszewski ec73a0c373
Some checks failed
Build and Deploy Thoughts / build-and-deploy-local (push) Failing after 1m50s
fix: update healthcheck command for frontend service and install curl in Dockerfile
2025-09-09 04:09:14 +02:00

30 lines
709 B
Docker

FROM node:22-slim AS builder
WORKDIR /app
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
# Install dependencies with Bun for speed
COPY --chown=node:node package.json bun.lock ./
RUN npm install -g bun
RUN bun install --frozen-lockfile
# Copy the rest of the app and build with Node's Next.js runtime
COPY --chown=node:node . .
ENV NODE_ENV=production
RUN bun run build
FROM node:22-slim AS release
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]