From a20eb825114b7d99f9aa86492e85452b8b1a7a9e Mon Sep 17 00:00:00 2001 From: Manindra de Mel Date: Sat, 21 Oct 2023 23:45:25 +1100 Subject: [PATCH] Added Docker Support --- Dockerfile | 21 +++++++++++++++++++++ online_log/app.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fe96960c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Start with a Python 3.9 base image +FROM python:3.9-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Install the project dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Set the environment variable for OpenAI API key +# (you'll need to provide the actual key when running the container) +ENV OPENAI_API_KEY=your_OpenAI_API_key + +# Expose a port if the project has any web-based features +EXPOSE 8080 + +# Set an entry point that runs a shell for interactive mode +ENTRYPOINT ["/bin/bash"] diff --git a/online_log/app.py b/online_log/app.py index a684179e..a91ffd83 100644 --- a/online_log/app.py +++ b/online_log/app.py @@ -65,4 +65,4 @@ if __name__ == "__main__": args = parser.parse_args() port.append(args.port) print(f"Please visit http://127.0.0.1:{port[-1]}/ for the front-end display page. \nIn the event of a port conflict, please modify the port argument (e.g., python3 app.py --port 8012).") - app.run(debug=False, port=port[-1]) \ No newline at end of file + app.run(host='0.0.0.0', debug=False, port=port[-1])