Spaces:
Sleeping
Sleeping
Download Dockerfile from SeriousSam07/Ritu-AI: direct link, hf CLI and curl.
- Browser
- Download file 839 Bytes
-
https://huggingface.co/spaces/SeriousSam07/Ritu-AI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/SeriousSam07/Ritu-AI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/SeriousSam07/Ritu-AI/resolve/main/Dockerfile
839 Bytes
| FROM node:18-alpine | |
| WORKDIR /app | |
| # Copy the frontend folder | |
| COPY frontend/ ./frontend/ | |
| WORKDIR /app/frontend | |
| # Install dependencies | |
| RUN npm install | |
| # Expose port 7860 for Hugging Face Spaces compatibility | |
| EXPOSE 7860 | |
| # We build the application at runtime (CMD) instead of build time (RUN) | |
| # so that the VITE_GEMINI_API_KEY environment variable provided by Hugging Face | |
| # or docker-compose is successfully injected into the static build. | |
| CMD ["sh", "-c", "if [ -f /var/run/secrets/VITE_GEMINI_API_KEY ]; then export VITE_GEMINI_API_KEY=$(cat /var/run/secrets/VITE_GEMINI_API_KEY); fi; if [ -f /var/run/secrets/GEMINI_API_KEY ]; then export GEMINI_API_KEY=$(cat /var/run/secrets/GEMINI_API_KEY); fi; export VITE_GEMINI_API_KEY=${VITE_GEMINI_API_KEY:-$GEMINI_API_KEY}; npm run build && npm run preview -- --port 7860 --host 0.0.0.0"] | |