NameIsJACK commited on
Commit
e21c1a5
·
verified ·
1 Parent(s): 414fd9d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ # Create and switch to a non-root user
4
+ RUN useradd -m -u 1000 user
5
+ USER root
6
+ ENV PATH="/home/user/.local/bin:$PATH"
7
+
8
+ WORKDIR /app
9
+ RUN apt-get update && apt-get install -y pandoc
10
+
11
+ # Create uploads dir (if used later) and set permissions
12
+ RUN mkdir -p /app/uploads && chown user:user /app/uploads
13
+
14
+ # Install dependencies
15
+ COPY --chown=user:user requirements.txt requirements.txt
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Copy source code
19
+ COPY --chown=user:user . /app
20
+
21
+ # Switch to non-root user
22
+ USER user
23
+
24
+ # Start FastAPI app (which internally starts the bot)
25
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]