File tree Expand file tree Collapse file tree 2 files changed +16
-19
lines changed
Expand file tree Collapse file tree 2 files changed +16
-19
lines changed Original file line number Diff line number Diff line change 11FROM python:3.9-slim
2-
3- RUN apt-get update \
4- && apt-get install -y --no-install-recommends \
5- build-essential libpq-dev libjpeg-dev zlib1g-dev \
2+ RUN apt-get update && apt-get install -y build-essential libpq-dev zlib1g-dev libjpeg-dev \
63 && rm -rf /var/lib/apt/lists/*
74
85WORKDIR /app
9-
106COPY requirements.txt .
117RUN pip install --no-cache-dir -r requirements.txt
12-
138COPY . .
149
15- RUN python manage.py collectstatic --no-input
16-
17- CMD ["gunicorn" , "casecrimetrace.wsgi:application" , "--bind" , "0.0.0.0:8000" ]
10+ EXPOSE 8000
11+ ENTRYPOINT []
12+ CMD python manage.py collectstatic --no-input \
13+ && gunicorn casecrimetrace.wsgi:application --bind 0.0.0.0:8000
Original file line number Diff line number Diff line change 3030
3131# SECURITY WARNING: don't run with debug turned on in production!
3232DEBUG = os .environ .get ("DEBUG_VALUE" ) == "True"
33- # DEBUG = True
33+ PGDATABASE = env ("PGDATABASE" , default = "postgres" )
34+ PGUSER = env ("PGUSER" , default = "postgres" )
35+ PGPASSWORD = env ("PGPASSWORD" , default = "" )
36+ PGHOST = env ("PGHOST" , default = "localhost" )
37+ PGPORT = env ("PGPORT" , default = "5432" )
38+
39+ DATABASE_URL = env (
40+ "DATABASE_URL" ,
41+ default = "sqlite:///" + str (BASE_DIR / "db.sqlite3" ),
42+ )
3443
3544ALLOWED_HOSTS = env .list (
3645 "ALLOWED_HOSTS" ,
37- default = [
38- "crimetrace.online" ,
39- "www.crimetrace.online" ,
40- "8fpbkwdj.up.railway.app" ,
41- "*" ,
42- ],
46+ default = ["crimetrace.online" , "www.crimetrace.online" , "8fpbkwdj.up.railway.app" ],
4347)
4448
4549CSRF_TRUSTED_ORIGINS = [
102106
103107# Database
104108# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
105-
106- DATABASE_URL = env ("DATABASE_URL" , default = "sqlite:///" + str (BASE_DIR / "db.sqlite3" ))
107-
108109DATABASES = {
109110 "default" : {
110111 "ENGINE" : "django.db.backends.postgresql" ,
You can’t perform that action at this time.
0 commit comments