File size: 535 Bytes
12c35ae
 
 
 
 
 
 
 
 
 
3ec7d8f
 
 
 
 
 
12c35ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM python:3.9

# Create user
RUN useradd -m -u 1000 user

# Set workdir and env
WORKDIR /app
ENV PATH="/home/user/.local/bin:$PATH"

# Copy requirements file first
COPY requirements/requirement.txt ./requirements.txt
COPY lib/ ./lib/

RUN pwd 

RUN ls

# Install deps as root
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Switch to non-root user
USER user

# Copy the app
COPY --chown=user src/ .

# Optional: debug
RUN ls -la /app

# Run the app
CMD ["waitress-serve", "--host=0.0.0.0", "--port=7860", "main:app1"]