Download Dockerfile from arshenoy/somAI: direct link, hf CLI and curl.
- Browser
- Download file 840 Bytes
-
https://huggingface.co/spaces/arshenoy/somAI/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/arshenoy/somAI/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/arshenoy/somAI/resolve/main/Dockerfile
840 Bytes
| # Stage 1: Build | |
| FROM node:18-alpine as build | |
| WORKDIR /app | |
| COPY package*.json ./ | |
| RUN npm install | |
| COPY . . | |
| ARG VITE_API_KEY | |
| ENV VITE_API_KEY=$VITE_API_KEY | |
| ARG VITE_MEDIA_API_URL | |
| ENV VITE_MEDIA_API_URL=$VITE_MEDIA_API_URL | |
| RUN npm run build | |
| # Stage 2: Serve | |
| FROM nginx:alpine | |
| COPY --from=build /app/dist /usr/share/nginx/html | |
| # FIX: Proper Nginx Config with MIME types to prevent black screen | |
| RUN echo 'server { \ | |
| listen 7860; \ | |
| root /usr/share/nginx/html; \ | |
| index index.html; \ | |
| include /etc/nginx/mime.types; \ | |
| \ | |
| location / { \ | |
| try_files $uri $uri/ /index.html; \ | |
| } \ | |
| \ | |
| location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ { \ | |
| expires 30d; \ | |
| add_header Cache-Control "public, no-transform"; \ | |
| } \ | |
| }' > /etc/nginx/conf.d/default.conf | |
| EXPOSE 7860 | |
| CMD ["nginx", "-g", "daemon off;"] |