-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (27 loc) · 824 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
37
38
39
40
41
42
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
# Create a non-root user
RUN useradd -m myuser
# Set work directory
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
EXPOSE 8000
# Copy and configure entrypoint.sh
COPY entrypoint.sh /app/entrypoint.sh
USER root
# Install netcat
RUN apt-get update && apt install netcat-traditional -y
RUN apt-get update && apt-get install -y supervisor
RUN chmod +x /app/entrypoint.sh
RUN touch /app/supervisord.log /app/supervisord.pid \
&& chown -R myuser:myuser /app
# Install NGINX
RUN apt-get update && apt-get install -y nginx && apt-get clean && rm -rf /var/lib/apt/lists/*
# Switch to non-root user
USER myuser
ENTRYPOINT ["/app/entrypoint.sh"]