Files
Michess/Dockerfile

30 lines
792 B
Docker

FROM node:lts-bookworm-slim
# Install git and stockfish (native binary)
RUN apt-get update && apt-get install -y --no-install-recommends git stockfish && rm -rf /var/lib/apt/lists/*
ENV PNPM_HOME=/usr/local/bin
WORKDIR /opt/michess/
COPY . .
RUN corepack enable && \
corepack prepare pnpm@latest --activate && \
pnpm config set store-dir /opt/michess/.pnpm-store && \
pnpm install --no-frozen-lockfile
# Build-time env vars for Next.js (baked into the frontend bundle)
ARG NEXT_PUBLIC_API_URL=http://localhost:3001
ARG NEXT_PUBLIC_APP_URL=http://localhost:3000
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL
# Build server and client
RUN pnpm build:server && pnpm build:client
EXPOSE 3000 3001
ENTRYPOINT ["pnpm"]
CMD ["start"]