arcticaurora commited on
Commit
acd6d81
·
verified ·
1 Parent(s): 0a065be

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install basic utilities
4
+ RUN apt-get update && apt-get install -y \
5
+ curl \
6
+ && rm -rf /var/lib/apt/lists/*
7
+
8
+ WORKDIR /app
9
+
10
+ # Create directory for files
11
+ RUN mkdir -p /app/files
12
+
13
+ # Create user to avoid running as root (similar to your main app)
14
+ RUN useradd -m -u 1000 user
15
+ # Change ownership of directories
16
+ RUN chown -R user:user /app
17
+ USER user
18
+ ENV PATH="/home/user/.local/bin:$PATH"
19
+ ENV PYTHONUNBUFFERED=1
20
+
21
+ # Install dependencies
22
+ COPY --chown=user requirements.txt .
23
+ RUN pip install --no-cache-dir -r requirements.txt
24
+
25
+ # Copy application code
26
+ COPY --chown=user . .
27
+
28
+ # Run the application
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]