docker-composing the debug=True version works

This commit is contained in:
stupidcomputer 2024-06-23 14:05:43 -05:00
parent 38614d477c
commit f8ac92e0ae
5 changed files with 17 additions and 20 deletions

3
.env.dev Normal file
View File

@ -0,0 +1,3 @@
DEBUG=1
SECRET_KEY=foo
DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]

View File

@ -1,10 +1,10 @@
version: '3.8'
services:
web:
build: ./franklincce
command: gunicorn franklincce.wsgi:application --bind 0.0.0.0:8000
build: ./app
command: python manage.py runserver 0.0.0.0:8000
volumes:
- ./franklincce/:/usr/src/franklincce
- ./franklincce/:/usr/src/app/
ports:
- 8000:8000
env_file:
- ./.env.dev

View File

@ -1,3 +1,4 @@
# pull official base image
FROM python:3.11.4-slim-buster
# set work directory
@ -12,9 +13,5 @@ RUN pip install --upgrade pip
COPY ./requirements.txt .
RUN pip install -r requirements.txt
# copy project
COPY . .
RUN mkdir /var/www/static -p
RUN python3 manage.py collectstatic --noinput

View File

@ -10,23 +10,20 @@ For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.2/ref/settings/
"""
import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
SECRET_KEY = os.environ.get("SECRET_KEY")
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-1%p#re)z*_xd9umo0!1foh(yiz&2=*5q#0b4(m42r0^m%kxli#'
DEBUG = bool(os.environ.get("DEBUG", default=0))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ["localhost", "192.168.0.87", "127.0.0.1", "[::1]"]
# Application definition
# 'DJANGO_ALLOWED_HOSTS' should be a single string of hosts with a space between each.
# For example: 'DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]'
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
INSTALLED_APPS = [
'explorer.apps.ExplorerConfig',

View File

@ -1,4 +1,4 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.mkShell {
nativeBuildInputs = with pkgs.python311Packages; [ django pymupdf ];
nativeBuildInputs = with pkgs.python311Packages; [ django pymupdf docker-compose ];
}