Files
thoughts/thoughts-frontend/Dockerfile
Gabriel Kaszewski b2d6be90c2
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Has been cancelled
test / unit (pull_request) Has been cancelled
test / integration (pull_request) Has been cancelled
chore: update README, Dockerfile, compose.yml — add frontend/worker services, SSR env var, feature list
2026-05-15 01:26:23 +02:00

33 lines
837 B
Docker

FROM node:22-slim AS builder
WORKDIR /app
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
ARG NEXT_PUBLIC_SERVER_SIDE_API_URL
ENV NEXT_PUBLIC_SERVER_SIDE_API_URL=$NEXT_PUBLIC_SERVER_SIDE_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"]