Spaces:
Running
Running
# Use a base image with Python and Node.js pre-installed | |
FROM node:22-bullseye-slim | |
# Install Python and pip | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
python3 \ | |
python3-pip \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install corepack (for pnpm and yarn) and make them available | |
RUN corepack enable \ | |
&& corepack prepare pnpm@latest --activate \ | |
&& corepack prepare yarn@latest --activate | |
# Install huggingface_hub and huggingface_hub[cli] | |
RUN pip install -U "huggingface_hub" | |
# Define a working directory | |
WORKDIR /app | |
# Copy the script that will handle the build process | |
COPY build.sh /app/build.sh | |
RUN chmod +x /app/build.sh | |
COPY app.js /app/app.js | |
COPY index.html /app/index.html | |
RUN mkdir /app/space | |
RUN chown -R 1000:1000 /app/space | |
# Command to run the build script, when launched from a job | |
# CMD ["/app/build.sh"] | |
CMD ["python3", "-m", "http.server", "7860", "--directory", "/app"] |