Update Dockerfile
Browse files- Dockerfile +17 -10
Dockerfile
CHANGED
@@ -3,7 +3,7 @@ FROM python:3.10-slim
|
|
3 |
ENV TZ=Asia/Kolkata
|
4 |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
5 |
|
6 |
-
# Install
|
7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
8 |
gdb \
|
9 |
git \
|
@@ -14,26 +14,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
14 |
neofetch && \
|
15 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
16 |
|
|
|
17 |
WORKDIR /app
|
18 |
|
|
|
19 |
COPY . .
|
20 |
|
|
|
21 |
ENV PIP_ROOT_USER_ACTION=ignore
|
22 |
|
23 |
-
#
|
24 |
-
RUN pip install --upgrade pip
|
25 |
-
|
26 |
|
27 |
-
# Run
|
28 |
-
RUN bash installer.sh
|
29 |
|
30 |
-
# Fix Git
|
31 |
-
RUN git config --
|
32 |
|
33 |
# Ensure writable directories
|
34 |
-
RUN mkdir -p /app/sessions
|
35 |
-
|
|
|
|
|
36 |
|
|
|
37 |
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
38 |
|
|
|
39 |
CMD ["bash", "startup"]
|
|
|
3 |
ENV TZ=Asia/Kolkata
|
4 |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
5 |
|
6 |
+
# Install required system packages (fixed syntax)
|
7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
8 |
gdb \
|
9 |
git \
|
|
|
14 |
neofetch && \
|
15 |
apt-get clean && rm -rf /var/lib/apt/lists/*
|
16 |
|
17 |
+
# Set working directory
|
18 |
WORKDIR /app
|
19 |
|
20 |
+
# Copy all files to container
|
21 |
COPY . .
|
22 |
|
23 |
+
# Avoid pip install as root errors
|
24 |
ENV PIP_ROOT_USER_ACTION=ignore
|
25 |
|
26 |
+
# Upgrade pip and install Python requirements
|
27 |
+
RUN pip install --upgrade pip
|
28 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
29 |
|
30 |
+
# Optional: Run installer if needed
|
31 |
+
RUN bash installer.sh || true
|
32 |
|
33 |
+
# Fix Git 'dubious ownership' issue safely
|
34 |
+
RUN git config --system --add safe.directory /app
|
35 |
|
36 |
# Ensure writable directories
|
37 |
+
RUN mkdir -p /app/sessions && chmod -R 777 /app/sessions
|
38 |
+
RUN mkdir -p /app/resources/auth && chmod -R 777 /app/resources
|
39 |
+
RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp
|
40 |
+
RUN mkdir -p /app/pdf && chmod -R 777 /app/pdf
|
41 |
|
42 |
+
# Set Python path explicitly
|
43 |
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
44 |
|
45 |
+
# Start the bot
|
46 |
CMD ["bash", "startup"]
|