# Auto-generated by Shiplet
# Template: Vite / React + SWC + TS
ARG NODE_VERSION=22
FROM node:${NODE_VERSION}-bookworm-slim

ARG PACKAGE_MANAGER=npm
ARG TZ=UTC
ENV TZ=${TZ}
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y \
    && apt-get install -y --no-install-recommends \
    curl git ca-certificates tzdata \
    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo "$TZ" > /etc/timezone \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# Package manager
RUN corepack enable && corepack prepare pnpm@latest --activate

WORKDIR /var/www/html

# Vite HMR needs this port exposed
EXPOSE 5173

# Default: run dev server
# Override in shiplet.yml command: or use shiplet npm run build
CMD ["npx", "vite", "--host", "0.0.0.0"]
