Spaces:
Running
Running
Download Dockerfile from TwanAPI/UploadFile: direct link, hf CLI and curl.
- Browser
- Download file 1.36 kB
-
https://huggingface.co/spaces/TwanAPI/UploadFile/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/TwanAPI/UploadFile/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/TwanAPI/UploadFile/resolve/main/Dockerfile
1.36 kB
| FROM golang:1.23-bookworm AS go-build | |
| WORKDIR /src | |
| COPY go.mod go.sum ./ | |
| RUN go mod download | |
| COPY *.go ./ | |
| COPY web ./web | |
| RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/server . | |
| FROM node:20-bookworm-slim AS fe-build | |
| WORKDIR /frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm install --no-audit --no-fund | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| FROM python:3.12-slim-bookworm | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| NODE_ENV=production \ | |
| LISTEN_ADDR=:7860 \ | |
| BACKEND_URL=http://127.0.0.1:7860 \ | |
| FRONTEND_URL=http://127.0.0.1:3000 \ | |
| TEMP_DIR=/tmp/hf-upload | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| libstdc++6 \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && pip install --no-cache-dir -U huggingface_hub hf_xet \ | |
| && useradd --create-home --uid 1000 app | |
| COPY --from=fe-build /usr/local/bin/node /usr/local/bin/node | |
| WORKDIR /app | |
| COPY --from=go-build /out/server /app/server | |
| COPY --from=fe-build /frontend/.next/standalone /app/frontend | |
| COPY --from=fe-build /frontend/.next/static /app/frontend/.next/static | |
| COPY users.json file_owners.json shares.json /app/ | |
| COPY start.sh /app/start.sh | |
| RUN sed -i 's/\r$//' /app/start.sh && chmod +x /app/start.sh \ | |
| && mkdir -p /tmp/hf-upload && chown -R app:app /app /tmp/hf-upload | |
| USER app | |
| EXPOSE 7860 | |
| CMD ["/app/start.sh"] | |