peace4ever commited on
Commit
c00f6cc
·
verified ·
1 Parent(s): fb2d82a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -23
Dockerfile CHANGED
@@ -1,37 +1,24 @@
1
- # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  FROM python:3.9
5
 
6
  WORKDIR /code
7
 
8
  COPY ./requirements.txt /code/requirements.txt
 
 
 
 
 
9
  ENV TRANSFORMERS_CACHE=/code/.cache
 
 
10
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
 
11
  RUN pip install flask
12
- # RUN chmod -R 755 /code/.cache
13
 
14
  COPY app.py .
 
15
  EXPOSE 5000
16
 
17
  # Command to run your Flask app
18
  CMD ["flask", "run", "--host", "0.0.0.0"]
19
- # CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "peace4ever-peace4ever/software-project-Sentiment_Analysis.hf.space"]
20
- # Base image (replace with a suitable Python image)
21
- # FROM python:3.9
22
-
23
- # # Create work directory
24
- # WORKDIR /app
25
-
26
- # # Copy requirements (excluding tkinter)
27
- # COPY requirements.txt .
28
- # RUN pip install --no-cache-dir --upgrade -r requirements.txt
29
-
30
- # # Copy your application code
31
- # COPY app.py . # Replace with your main script name (containing Flask app)
32
-
33
- # # Expose port (optional)
34
- # EXPOSE 5000
35
-
36
- # # Command to run your Flask app
37
- # CMD ["flask", "run", "--host", "0.0.0.0"]
 
 
 
 
1
  FROM python:3.9
2
 
3
  WORKDIR /code
4
 
5
  COPY ./requirements.txt /code/requirements.txt
6
+
7
+ # Create the cache directory with the appropriate permissions
8
+ RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache
9
+
10
+ # Set the environment variable
11
  ENV TRANSFORMERS_CACHE=/code/.cache
12
+
13
+ # Install the requirements
14
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
15
+
16
+ # Install Flask
17
  RUN pip install flask
 
18
 
19
  COPY app.py .
20
+
21
  EXPOSE 5000
22
 
23
  # Command to run your Flask app
24
  CMD ["flask", "run", "--host", "0.0.0.0"]