| FROM node:20-alpine | |
| WORKDIR /app | |
| # Install dependencies at image build time (faster container start) | |
| COPY package*.json ./ | |
| RUN npm install --include=dev | |
| # Install static file server | |
| RUN npm install -g serve | |
| # Copy source | |
| COPY . . | |
| EXPOSE 7860 | |
| # At container start: write the HF Secret into .env.local, build, then serve | |
| CMD sh -c 'echo "GEMINI_API_KEY=$GEMINI_API_KEY" > .env.local && npm run build && serve -s dist -l 7860' | |