mirror of
https://github.com/cdryzun/tg_bot_collections.git
synced 2025-04-29 00:27:09 +08:00
commit
6e0ae560f9
21
Dockerfile
Normal file
21
Dockerfile
Normal file
@ -0,0 +1,21 @@
|
||||
FROM bitnami/python:3.10
|
||||
WORKDIR /app
|
||||
# Update the package list and install necessary packages including GDAL and Cairo
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
gdal-bin \
|
||||
libgdal-dev \
|
||||
libcairo2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
# Set environment variables so that Python package installer can find gdal-config
|
||||
ENV CPLUS_INCLUDE_PATH=/usr/include/gdal
|
||||
ENV C_INCLUDE_PATH=/usr/include/gdal
|
||||
# Copy necessary files
|
||||
COPY requirements.txt ./
|
||||
# Upgrade pip and install dependencies from requirements.txt
|
||||
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
||||
# Copy project files into the container
|
||||
COPY *.py .
|
||||
COPY handlers /app/handlers
|
||||
# Command to run the application, using the TELEGRAM_BOT_TOKEN environment variable
|
||||
CMD python tg.py ${TELEGRAM_BOT_TOKEN}
|
@ -45,6 +45,10 @@ for yihong0618's channel: https://t.me/hyi0618
|
||||
3. export GOOGLE_GEMINI_KEY=${your_google_gemini_apikey}
|
||||
4. python tg.py ${telegram_bot_token}
|
||||
|
||||
### Run from Docker
|
||||
1. docker build -t tg_bot_collections .
|
||||
2. docker run -d --name tg_bot_collections -e GOOGLE_GEMINI_KEY='${GOOGLE_GEMINI_KEY}' -e TELEGRAM_BOT_TOKEN='${TELEGRAM_BOT_TOKEN}' --network host tg_bot_collections
|
||||
|
||||
|
||||
## HOW TO Use
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user