mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2026-01-07 15:05:41 +01:00
update docker configuration
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -1,28 +1,15 @@
|
||||
# Use the official Python image as the base image
|
||||
FROM python:3.10.8
|
||||
FROM python:3.10-slim
|
||||
|
||||
# Create a user named appuser
|
||||
RUN useradd -m appuser
|
||||
|
||||
# Switch to the appuser user
|
||||
USER appuser
|
||||
|
||||
WORKDIR /home/appuser/
|
||||
|
||||
ENV PATH="/home/appuser/.local/bin:$PATH"
|
||||
|
||||
# Install pipenv
|
||||
RUN pip install --user pipenv
|
||||
|
||||
# Pull the repository from Github
|
||||
RUN git clone --depth=1 https://github.com/n3d1117/chatgpt-telegram-bot.git app
|
||||
|
||||
# Enter the repository directory
|
||||
WORKDIR /home/appuser/app
|
||||
COPY . .
|
||||
COPY .env .
|
||||
RUN pipenv install --system --deploy --ignore-pipfile
|
||||
|
||||
# Install the dependencies specified in the Pipfile in the repository
|
||||
RUN pipenv install --deploy
|
||||
|
||||
ENTRYPOINT ["python", "-m", "pipenv", "run"]
|
||||
# Run the main.py file
|
||||
CMD ["python", "main.py"]
|
||||
CMD ["python", "main.py"]
|
||||
@@ -1,7 +1,10 @@
|
||||
version: '3'
|
||||
services:
|
||||
chatgpt:
|
||||
image: sheepgreen/chatgpt
|
||||
chatgpt-telegram-bot:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./.env:/home/appuser/app/.env
|
||||
- .:/home/appuser/app
|
||||
- .env:/home/appuser/app/.env
|
||||
restart: always
|
||||
|
||||
Reference in New Issue
Block a user