Spaces:
No application file
No application file
# Use the specified Python image as a base | |
FROM python:3.10.13-slim-bullseye | |
# Install Node.js | |
RUN apt-get update && apt-get install -y curl && \ | |
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \ | |
apt-get install -y nodejs | |
# Set the working directory in the Docker image | |
WORKDIR /app | |
# Copy the entire web directory into the Docker image | |
COPY ./web /app/web | |
# Build the web application | |
WORKDIR /app/web | |
RUN npm install && npm run build | |
# Return to the base directory | |
WORKDIR /app | |
# Copy the rest of the necessary files into the Docker image | |
COPY ./free_one_api /app/free_one_api | |
COPY ./requirements.txt ./main.py /app/ | |
# Install the Python dependencies and remove unnecessary packages | |
RUN pip install --no-cache -r requirements.txt \ | |
&& pip uninstall torch tensorflow transformers triton -y \ | |
&& rm -rf /usr/local/lib/python3.10/site-packages/nvidia* | |
EXPOSE 7860 | |
# Specify the command to run when the Docker container starts | |
CMD [ "python", "main.py" ] | |