-
Notifications
You must be signed in to change notification settings - Fork 0
/
DOCKERFILE
36 lines (26 loc) · 955 Bytes
/
DOCKERFILE
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
32
33
34
35
36
# Use an updated and specific version of the Python image
FROM python:3.11-slim-bullseye
# Define work directory
WORKDIR /app
# Set Python to not generate .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Set Python stdout and stderr streams to be unbuffered
ENV PYTHONUNBUFFERED=1
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends gcc libffi-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Update pip and install dependencies via wheel to speed up installation
RUN python -m pip install --upgrade pip setuptools wheel
# Copy only the requirements file to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Specify non-root user to run the app
RUN useradd -m myuser
USER myuser
# Expose the port the app runs on
EXPOSE 4295
# Command to run the application
CMD ["python", "./autodns.py"]