File size: 649 Bytes
0755d10
 
 
 
 
 
 
 
 
 
 
44dc924
 
 
0755d10
 
44dc924
 
0755d10
 
44dc924
 
0755d10
44dc924
0755d10
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
# Use a base Ubuntu image
FROM ubuntu:22.04

# Install system dependencies and Python
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    python3 \
    python3-pip \
    python3-dev \
    && rm -rf /var/lib/apt/lists/*

# Create a non-root user and set permissions
RUN useradd -m appuser && mkdir /app && chown appuser:appuser /app
USER appuser
WORKDIR /app

# Copy requirements.txt and install dependencies
COPY --chown=appuser:appuser requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY --chown=appuser:appuser . .

# Run the script
CMD ["python3", "cli.py"]