-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
35 lines (26 loc) · 822 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
FROM python:3.12-slim
# Create a non-root user and add sudo permision
RUN adduser --no-create-home nonroot
RUN usermod -aG sudo nonroot
# Update the package list and clenaup after the install
RUN apt update \
&& apt upgrade -y \
&& apt-get install -y --no-install-recommends \
&& apt-get clean \
&& apt-get autoclean \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/*
# Set the non-root user as the default user
USER nonroot
# set working directory
WORKDIR /home/nonroot/app
# set environment variables
ENV APP_ENV=production
ENV PYTHONPATH="${PYTHONPATH}:/home/nonroot/app/src"
# Install requirements
COPY src/pururu/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project
COPY ./src/ ./
# Run the application
CMD ["python", "pururu/bot.py"]