ruslanmv commited on
Commit
cfbacd5
1 Parent(s): 663a7c4
Files changed (2) hide show
  1. app.py +1 -1
  2. dockerfile +29 -0
app.py CHANGED
@@ -148,4 +148,4 @@ def reset_quiz():
148
  participant["score"] = 0
149
 
150
  if __name__ == '__main__':
151
- socketio.run(app, debug=True)
 
148
  participant["score"] = 0
149
 
150
  if __name__ == '__main__':
151
+ socketio.run(app, host='0.0.0.0', port=7860, debug=True)
dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python image with version 3.9
2
+ FROM python:3.9
3
+
4
+ # Create a new user to run the application
5
+ RUN useradd -m -u 1000 user
6
+
7
+ # Set the user for subsequent commands
8
+ USER user
9
+
10
+ # Update the PATH environment variable
11
+ ENV PATH="/home/user/.local/bin:$PATH"
12
+
13
+ # Set the working directory
14
+ WORKDIR /app
15
+
16
+ # Copy the requirements.txt file into the container
17
+ COPY --chown=user ./requirements.txt requirements.txt
18
+
19
+ # Install the dependencies listed in requirements.txt
20
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
21
+
22
+ # Copy the entire project into the container
23
+ COPY --chown=user . /app
24
+
25
+ # Expose the application port (7860) for Hugging Face Spaces
26
+ EXPOSE 7860
27
+
28
+ # Set the command to run the application using Uvicorn
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]