arcticaurora commited on
Commit
564f14a
·
verified ·
1 Parent(s): 829c20c

Create Dockerfile

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