peace4ever commited on
Commit
9baefed
1 Parent(s): af9f7c5

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -27
Dockerfile CHANGED
@@ -1,3 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.9-slim
2
 
3
  WORKDIR /code
@@ -17,34 +41,11 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
17
  # Copy application code
18
  COPY app.py .
19
 
20
- # Expose the application port
21
- EXPOSE 7860
22
 
23
- # Ensure the entrypoint is correct
24
- CMD ["python", "app.py"]
25
 
26
 
27
- # FROM python:3.9
28
-
29
- # WORKDIR /code
30
-
31
- # COPY ./requirements.txt /code/requirements.txt
32
-
33
- # # Create the cache directory with the appropriate permissions
34
- # RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache
35
-
36
- # # Set the environment variable
37
- # ENV TRANSFORMERS_CACHE=/code/.cache
38
-
39
- # # Install the requirements
40
- # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
41
-
42
- # # Install Flask
43
- # RUN pip install flask
44
-
45
- # COPY app.py .
46
-
47
- # EXPOSE 5000
48
 
49
- # # Command to run your Flask app
50
- # CMD ["flask", "run", "--host", "0.0.0.0"]
 
1
+ # FROM python:3.9-slim
2
+
3
+ # WORKDIR /code
4
+
5
+ # # Copy requirements first to leverage caching
6
+ # COPY ./requirements.txt /code/requirements.txt
7
+
8
+ # # Create the cache directory with the appropriate permissions
9
+ # RUN mkdir -p /code/.cache && chmod -R 777 /code/.cache
10
+
11
+ # # Set the environment variable for the transformers cache
12
+ # ENV TRANSFORMERS_CACHE=/code/.cache
13
+
14
+ # # Install dependencies
15
+ # RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
+
17
+ # # Copy application code
18
+ # COPY app.py .
19
+
20
+ # # Expose the application port
21
+ # EXPOSE 7860
22
+
23
+ # # Ensure the entrypoint is correct
24
+ # CMD ["python", "app.py"]
25
  FROM python:3.9-slim
26
 
27
  WORKDIR /code
 
41
  # Copy application code
42
  COPY app.py .
43
 
44
+ # Expose the Streamlit default port
45
+ EXPOSE 8501
46
 
47
+ # Command to run the Streamlit app
48
+ CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]
49
 
50
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51