diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..311b9b9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,78 @@ +# Virtual environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Python cache files +__pycache__/ + +# SQLite database +db.sqlite3 +db.sqlite3-journal + +# User-uploaded media +media + +# Collected static files +staticfiles/ + +# Coverage +.coverage +.coverage.* +coverage.* +htmlcov/ + +# Chromedriver +chromedriver +chromedriver.exe + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows shortcuts +*.lnk diff --git a/.gitignore b/.gitignore index 79c4c76..311b9b9 100644 --- a/.gitignore +++ b/.gitignore @@ -75,4 +75,4 @@ ehthumbs_vista.db $RECYCLE.BIN/ # Windows shortcuts -*.lnk \ No newline at end of file +*.lnk diff --git a/.python-version b/.python-version index 14fc9e9..9ac3804 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.10.6 \ No newline at end of file +3.11.5 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..42c596f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# Use official Python container image +FROM docker.io/library/python:3.11.5-alpine + +# Configure environment variables +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONBUFFERED=1 + +# TODO: Configure environment variables required by Django project +# e.g., database connection, parameterised configuration in settings.py + +# Set the active working directory in the container +WORKDIR /app + +# Copy the requirements file into the container +COPY requirements.txt . + +# Install the declared app dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the source code files into the container +COPY . . + +# Expose the port that the app will run on +EXPOSE 8000 + +# Run the app +CMD ["/bin/sh", "-c", "python manage.py migrate && gunicorn project_django.wsgi --log-file -"] diff --git a/Procfile b/Procfile index 10c02ca..2827aec 100644 --- a/Procfile +++ b/Procfile @@ -1,2 +1 @@ -release: python manage.py migrate -web: gunicorn project_django.wsgi --log-file - \ No newline at end of file +web: python manage.py migrate && gunicorn project_django.wsgi --log-file - diff --git a/runtime.txt b/runtime.txt index ee92de7..3124d55 100644 --- a/runtime.txt +++ b/runtime.txt @@ -1 +1 @@ -python-3.10.6 \ No newline at end of file +python-3.11.5