From fe7ed2593ac7179144c25f87b35825fe520caa53 Mon Sep 17 00:00:00 2001 From: Vinod Sharma Date: Sun, 20 Oct 2024 07:09:23 +0000 Subject: [PATCH] Dockerfile added --- Dockerfile | 17 +++++++++++++++++ cool_counters/cool_counters/settings.py | 2 +- requirements.txt | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..42c8c08 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# Use an official Python image as the base image +FROM python:3.9-slim + +# Set the working directory inside the container +WORKDIR /app + +# Copy the files into the container +COPY . /app/ + +# Install Python dependencies +RUN pip install --no-cache-dir -r requirements.txt + +#Run migrations to update/create database +RUN python cool_counters/manage.py migrate + +# Run the Django application (assuming manage.py is present) +CMD ["python", "cool_counters/manage.py", "runserver", "0.0.0.0:8000"] 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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..d3e4ba5 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +django