# Proa Playground — self-contained Docker image
# Usage:
#   docker build -t proa/playground .
#   docker run -p 3001:3001 proa/playground

FROM node:22-slim AS base

# Install Bun
RUN apt-get update -qq && apt-get install -y -qq curl unzip python3 > /dev/null 2>&1 \
    && curl -fsSL https://bun.sh/install | bash \
    && ln -s /root/.bun/bin/bun /usr/local/bin/bun \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy everything from the package
COPY . .

# Install JS dependencies at build time (not at runtime)
RUN cd hono-ssr && npm install --silent 2>/dev/null && cd .. \
    && cd react-ssr-shared && npm install --silent 2>/dev/null && cd ..

RUN chmod +x proa-playground

EXPOSE 3001

CMD ["./proa-playground"]
