Assem0 commited on
Commit
b364cc1
·
1 Parent(s): ed5a85a

Add Docker configuration

Browse files
Files changed (2) hide show
  1. .dockerignore +13 -0
  2. Dockerfile +26 -0
.dockerignore ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .git
2
+ __pycache__
3
+ *.pyc
4
+ .env
5
+ .venv
6
+ virenv
7
+ myenv
8
+ DIAGRAMS.md
9
+ DOCKER_SIMPLE.md
10
+ HOSTING.md
11
+ RESEARCH_DIAGRAMS.md
12
+ WEBCRAFT_PROJECT_SUMMARY.md
13
+ diagrams/
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ PYTHONDONTWRITEBYTECODE=1 \
7
+ HOME=/home/user \
8
+ PATH=/home/user/.local/bin:$PATH
9
+
10
+ # Create a non-root user
11
+ RUN useradd -m -u 1000 user
12
+ USER user
13
+ WORKDIR $HOME/app
14
+
15
+ # Install dependencies
16
+ COPY --chown=user requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy the rest of the application code
20
+ COPY --chown=user . .
21
+
22
+ # Expose the port (Hugging Face Spaces use 7860)
23
+ EXPOSE 7860
24
+
25
+ # Command to run the application
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]