-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (29 loc) · 1015 Bytes
/
Dockerfile
File metadata and controls
38 lines (29 loc) · 1015 Bytes
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
FROM python:3-slim-bookworm
LABEL authors="anthony"
ENV LANG=C.UTF-8
ENV PATH="/home/anonymousbot/.local/bin:${PATH}"
# Install system dependencies
RUN apt-get update -y && apt-get install -y --no-install-recommends gcc \
&& rm -rf /var/lib/apt/lists/*
# Install system dependencies
RUN apt-get update -y
RUN apt-get install -y --no-install-recommends gcc
RUN rm -rf /var/lib/apt/lists/*
# Create user
RUN useradd -rm anonymousbot
USER anonymousbot
WORKDIR /home/anonymousbot
# Install python dependencies
COPY --chown=anonymousbot:anonymousbot requirements.txt requirements.txt
# Install Python dependencies
RUN pip install --upgrade pip
RUN pip install --break-system-packages -r requirements.txt --no-warn-script-location
# Copy rest of the project files
COPY --chown=anonymousbot:anonymousbot . .
# Copy entrypoint script and set permissions
USER root
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Use the entrypoint script
ENTRYPOINT ["/entrypoint.sh"]
CMD ["python3", "main.py"]