Spaces:
No application file
No application file
Commit
·
60bb0aa
1
Parent(s):
cacc3dd
Update DockerFile
Browse files- DockerFile +25 -8
DockerFile
CHANGED
|
@@ -1,15 +1,32 @@
|
|
| 1 |
-
# Use the
|
| 2 |
-
FROM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Set the working directory in the Docker image
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Copy the
|
| 8 |
-
COPY ./
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
|
|
|
|
|
|
|
| 12 |
|
| 13 |
# Specify the command to run when the Docker container starts
|
| 14 |
-
|
| 15 |
-
CMD ["python main.py"]
|
|
|
|
| 1 |
+
# Use the specified Python image as a base
|
| 2 |
+
FROM python:3.10.13-slim-bullseye
|
| 3 |
+
|
| 4 |
+
# Install Node.js
|
| 5 |
+
RUN apt-get update && apt-get install -y curl && \
|
| 6 |
+
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
|
| 7 |
+
apt-get install -y nodejs
|
| 8 |
|
| 9 |
# Set the working directory in the Docker image
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# Copy the entire web directory into the Docker image
|
| 13 |
+
COPY ./web /app/web
|
| 14 |
+
|
| 15 |
+
# Build the web application
|
| 16 |
+
WORKDIR /app/web
|
| 17 |
+
RUN npm install && npm run build
|
| 18 |
+
|
| 19 |
+
# Return to the base directory
|
| 20 |
+
WORKDIR /app
|
| 21 |
+
|
| 22 |
+
# Copy the rest of the necessary files into the Docker image
|
| 23 |
+
COPY ./free_one_api /app/free_one_api
|
| 24 |
+
COPY ./requirements.txt ./main.py /app/
|
| 25 |
|
| 26 |
+
# Install the Python dependencies and remove unnecessary packages
|
| 27 |
+
RUN pip install --no-cache -r requirements.txt \
|
| 28 |
+
&& pip uninstall torch tensorflow transformers triton -y \
|
| 29 |
+
&& rm -rf /usr/local/lib/python3.10/site-packages/nvidia*
|
| 30 |
|
| 31 |
# Specify the command to run when the Docker container starts
|
| 32 |
+
CMD [ "python", "main.py" ]
|
|
|