From b243c1f3e66777f3ef4c8c60509cef9c2caa8028 Mon Sep 17 00:00:00 2001 From: Imran-Shaikh-2001 <159260842+Imran-Shaikh-2001@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:15:04 +0530 Subject: [PATCH 1/3] Created Dockerfile to run this app in any operating system --- Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..72e0287 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Base Image +FROM python:3.7 + +# Set the working directory inside the container +WORKDIR /app + +# Copy all files from the current directory on the host to the /app directory inside the container +COPY . . + +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt +# The --no-cache-dir flag is useful to avoid caching the downloaded packages in the image, +# which helps reduce the image size. + +# Ensure database migrations are applied (optional, but common for Django apps) +RUN python cool_counters/manage.py migrate +# This assumes you have Django or a similar app. Ensure that the "cool_counters" folder exists +# in the container at this point and that it's accessible. + +# Expose port 8000 (this is optional but good practice for Docker) +EXPOSE 8000 + +# Command to run the application +CMD ["python", "cool_counters/manage.py", "runserver", "0.0.0.0:8000"] +# This will start the Django development server. Make sure this is appropriate for production. From 3379a958b5bcf9b41dcdad7184684185642e4580 Mon Sep 17 00:00:00 2001 From: Imran-Shaikh-2001 <159260842+Imran-Shaikh-2001@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:17:15 +0530 Subject: [PATCH 2/3] Created requirements.txt to download required dependencies --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d3e4ba5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django From aee9301e5faf6a6e32ce430cc2548c9be2fbc002 Mon Sep 17 00:00:00 2001 From: Imran-Shaikh-2001 <159260842+Imran-Shaikh-2001@users.noreply.github.com> Date: Tue, 12 Nov 2024 16:19:19 +0530 Subject: [PATCH 3/3] Updated settings.py to access from anywhere on the internet. --- cool_counters/cool_counters/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cool_counters/cool_counters/settings.py b/cool_counters/cool_counters/settings.py index 860bd04..66fcc40 100644 --- a/cool_counters/cool_counters/settings.py +++ b/cool_counters/cool_counters/settings.py @@ -25,7 +25,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition