Files
thoughts/thoughts-frontend/Dockerfile
Gabriel Kaszewski 5282376860
All checks were successful
Build and Deploy Thoughts / build-and-deploy-local (push) Successful in 1m20s
fix: simplify CMD instruction in Dockerfile by removing redundant parameters
2025-09-09 04:19:40 +02:00

30 lines
731 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
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]