-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
39 lines (30 loc) · 909 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
# Use Python 3.10 as base image
FROM python:3.10-slim
# Set working directory
WORKDIR /code
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
software-properties-common \
git \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY custombot/requirements.txt requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY custombot /code/custombot
# Set environment variables
ENV PYTHONPATH=/code
ENV PORT=7860
# Create necessary directories
RUN mkdir -p /code/custombot/bots
RUN mkdir -p /code/custombot/data
RUN mkdir -p /code/custombot/static
RUN mkdir -p /code/custombot/templates
# Make port 7860 available (Hugging Face Spaces default port)
EXPOSE 7860
# Set the entrypoint command
CMD ["python", "custombot/run.py"]