Update Dockerfile
Browse files- Dockerfile +20 -18
Dockerfile
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
|
|
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
|
7 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
8 |
gdb \
|
9 |
git \
|
@@ -17,31 +18,32 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
17 |
# Set working directory
|
18 |
WORKDIR /app
|
19 |
|
20 |
-
# Copy
|
21 |
COPY . .
|
22 |
|
23 |
-
# Avoid pip
|
24 |
ENV PIP_ROOT_USER_ACTION=ignore
|
25 |
|
26 |
-
#
|
27 |
-
RUN pip install --upgrade pip
|
28 |
-
|
29 |
-
RUN pip install uvicorn fastapi
|
30 |
|
31 |
-
# Optional
|
32 |
-
RUN bash installer.sh || true
|
33 |
|
34 |
-
# Fix Git
|
35 |
RUN git config --system --add safe.directory /app
|
36 |
|
37 |
-
#
|
38 |
-
RUN mkdir -p /app/sessions
|
39 |
-
|
40 |
-
RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp
|
41 |
-
RUN mkdir -p /app/pdf && chmod -R 777 /app/pdf
|
42 |
|
43 |
-
# Set
|
44 |
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
45 |
|
46 |
-
#
|
47 |
-
|
|
|
|
|
|
|
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# Set timezone
|
4 |
ENV TZ=Asia/Kolkata
|
5 |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
6 |
|
7 |
+
# Install required system packages
|
8 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
9 |
gdb \
|
10 |
git \
|
|
|
18 |
# Set working directory
|
19 |
WORKDIR /app
|
20 |
|
21 |
+
# Copy project files
|
22 |
COPY . .
|
23 |
|
24 |
+
# Avoid pip permission issues
|
25 |
ENV PIP_ROOT_USER_ACTION=ignore
|
26 |
|
27 |
+
# Install Python dependencies
|
28 |
+
RUN pip install --upgrade pip && \
|
29 |
+
pip install --no-cache-dir -r requirements.txt
|
|
|
30 |
|
31 |
+
# (Optional) Skip or modify if installer.sh fails
|
32 |
+
RUN [ -f installer.sh ] && bash installer.sh || true
|
33 |
|
34 |
+
# Fix Git ownership warning
|
35 |
RUN git config --system --add safe.directory /app
|
36 |
|
37 |
+
# Set folder permissions
|
38 |
+
RUN mkdir -p /app/sessions /app/resources/auth /app/tmp /app/pdf && \
|
39 |
+
chmod -R 777 /app/sessions /app/resources /app/tmp /app/pdf
|
|
|
|
|
40 |
|
41 |
+
# Set PYTHONPATH
|
42 |
ENV PYTHONPATH="${PYTHONPATH}:/app"
|
43 |
|
44 |
+
# Copy entrypoint
|
45 |
+
COPY entrypoint.sh /app/entrypoint.sh
|
46 |
+
RUN chmod +x /app/entrypoint.sh
|
47 |
+
|
48 |
+
# Run the bot/server
|
49 |
+
CMD ["/app/entrypoint.sh"]
|