Spaces:
Build error
Build error
Containerizing the app
Browse files- Dockerfile +16 -0
- app.py +1 -1
- build.sh +4 -0
Dockerfile
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10
|
| 2 |
+
|
| 3 |
+
# Set the working directory inside the container
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
# Copy the requirements.txt file into our working directory (/app) in the container
|
| 7 |
+
COPY requirements.txt .
|
| 8 |
+
|
| 9 |
+
# Install dependencies
|
| 10 |
+
RUN pip install --default-timeout=600 -r requirements.txt
|
| 11 |
+
|
| 12 |
+
# Copy the app.py file into our working directory (/app) in the container
|
| 13 |
+
COPY app.py .
|
| 14 |
+
|
| 15 |
+
# Command to run when the container starts
|
| 16 |
+
CMD ["python", "./app.py"]
|
app.py
CHANGED
|
@@ -25,4 +25,4 @@ iface = gr.Interface(
|
|
| 25 |
]
|
| 26 |
)
|
| 27 |
|
| 28 |
-
iface.launch()
|
|
|
|
| 25 |
]
|
| 26 |
)
|
| 27 |
|
| 28 |
+
iface.launch(server_name="0.0.0.0", server_port=7860)
|
build.sh
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
docker build . -t twitter_sentiment_analysis_app
|
| 2 |
+
docker images
|
| 3 |
+
docker run -p 8080:7860 --name twitter_sentiment_analysis_app image_id
|
| 4 |
+
docker ps
|