From 3d06d6b799717ff64139fe8556f3503ecd1105a1 Mon Sep 17 00:00:00 2001 From: Abhinav kumar <126642111+Abhinavcode13@users.noreply.github.com> Date: Thu, 6 Jun 2024 07:20:05 +0530 Subject: [PATCH 1/3] Support Dockerfile --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..fbc05006 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use an official Python runtime as a parent image +FROM python:3.10-slim + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy the requirements file into the container +COPY requirements.txt ./ + +# Install the dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the current directory contents into the container at /usr/src/app +COPY . . + +# Expose port 8080 to the outside world (if needed) +EXPOSE 8080 + +# Run the application +CMD ["python", "gpt_computer_assistant.py"] From 81ca85fbfa57dbfa1167640df71c9f70fa8fac80 Mon Sep 17 00:00:00 2001 From: Abhinav kumar <126642111+Abhinavcode13@users.noreply.github.com> Date: Thu, 6 Jun 2024 07:23:33 +0530 Subject: [PATCH 2/3] Minor fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fbc05006..bcd66b34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,7 +13,7 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container at /usr/src/app COPY . . -# Expose port 8080 to the outside world (if needed) +# Expose port 8080 EXPOSE 8080 # Run the application From b4e6b789048b8e3c9539c92c57fc2ac5d6bda8d0 Mon Sep 17 00:00:00 2001 From: Abhinav kumar <126642111+Abhinavcode13@users.noreply.github.com> Date: Tue, 11 Jun 2024 09:35:42 +0530 Subject: [PATCH 3/3] Add link --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index bcd66b34..1afbee51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,10 +11,14 @@ COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt # Copy the current directory contents into the container at /usr/src/app -COPY . . +COPY --link . . # Expose port 8080 EXPOSE 8080 +# Create a non-root user and switch to it +RUN useradd -m app_user +USER app_user + # Run the application CMD ["python", "gpt_computer_assistant.py"]