Merge pull request #24 from d3287t328/master

add a Dockerfile
This commit is contained in:
konrad 2023-08-31 22:04:39 +02:00 committed by GitHub
commit b2ca70279f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 0 deletions

17
Dockerfile Normal file
View File

@ -0,0 +1,17 @@
# Use an official Python runtime as a parent image
FROM python:3.9-slim-buster
# Set the working directory in the container to /app
WORKDIR /app
# Add the current directory contents into the container at /app
ADD . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Make port 80 available to the world outside this container
EXPOSE 80
# Run the command to start your application
CMD ["python", "./chatgpt.py"]

View File

@ -17,6 +17,17 @@ $ git clone https://github.com/knrd1/chatgpt.git
$ cd chatgpt
$ cp example-chat.conf chat.conf
```
To build the Docker image, you can use the following command:
```docker build -t my-python-app .```
To run the Docker container, you can use the following command:
```docker run -p 4000:80 my-python-app```
This Dockerfile ensures that your application runs in an isolated environment with its dependencies,
which enhances its security and reliability. However, for a production environment, you might want
to consider additional security measures, such as using a non-root user to run the application inside
the container1.
### Configuration:
Edit chat.conf and change variables. Example configuration for IRCNet:

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
openai
pyshorteners