diff --git a/TEKDB/.dockerignore b/TEKDB/.dockerignore new file mode 100644 index 00000000..1abb6152 --- /dev/null +++ b/TEKDB/.dockerignore @@ -0,0 +1,38 @@ +# Python +__pycache__/ +*.py[cod] +*.pyo +*.pyd + +# Virtual environments +env/ +venv/ +.venv/ + +# Editor & OS files +.DS_Store +.vscode/ +.idea/ + +# Git +.git +.gitignore + +# Build/dist +build/ +dist/ +*.egg-info + +# Static/local settings +media/ +static/ +local_settings.py +*.sqlite3 +*.log + +# Node +node_modules/ + +# Docker +Dockerfile +docker-compose*.yml diff --git a/TEKDB/.env.dev b/TEKDB/.env.dev index 4073116c..e145b076 100644 --- a/TEKDB/.env.dev +++ b/TEKDB/.env.dev @@ -3,7 +3,7 @@ SECRET_KEY=foo ALLOWED_HOSTS=localhost,127.0.0.1,[::1] SQL_ENGINE=django.contrib.gis.db.backends.postgis SQL_DATABASE=tekdb -SQL_USER=tekdb_user +SQL_USER=postgres SQL_PASSWORD=tekdb_password SQL_HOST=db SQL_PORT=5432 diff --git a/TEKDB/Dockerfile b/TEKDB/Dockerfile new file mode 100644 index 00000000..896b7676 --- /dev/null +++ b/TEKDB/Dockerfile @@ -0,0 +1,45 @@ +FROM python:3.11-slim + +# Prevent Python from writing .pyc files and enable unbuffered stdout/stderr +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +ENV PIP_NO_CACHE_DIR=1 + +# Install system dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + postgresql-client \ + gcc \ + gdal-bin \ + libgdal-dev \ + libgeos-dev \ + && rm -rf /var/lib/apt/lists/* + +# Set working directory +WORKDIR /usr/src/app + +# Copy requirements first (cache pip install step when dependencies don't change) +COPY requirements.txt requirements_linux.txt /usr/src/app/ + +# Upgrade pip and install Python dependencies +RUN pip install --upgrade pip \ + && pip install -r requirements.txt -r requirements_linux.txt + +# Copy the application code +COPY . /usr/src/app + +# Copy and make entrypoint executable. The repository contains `docker/entrypoint.sh` +# which runs collectstatic, migrations and launches uWSGI. +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + +# Expose the port the app runs on (entrypoint starts django development server or uWSGI on 8000) +EXPOSE 8000 + +# Default settings module (can be overridden at runtime) +ENV DJANGO_SETTINGS_MODULE=TEKDB.settings + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] + +# use development server by default +CMD ["dev"] diff --git a/TEKDB/TEKDB/local_settings.py.template b/TEKDB/TEKDB/local_settings.py.template index 4fe76e97..dfd96e86 100644 --- a/TEKDB/TEKDB/local_settings.py.template +++ b/TEKDB/TEKDB/local_settings.py.template @@ -6,13 +6,21 @@ ALLOWED_HOSTS = [ # SECRET_KEY='fixthisdjango' # DATABASES = { -# 'default': { -# 'ENGINE': 'django.contrib.gis.db.backends.postgis', -# 'NAME': 'DB Name', -# 'USER': 'add user', -# 'PASSWORD': 'add password', -# 'HOST': 'add host', -# 'PORT': add number, +# "default": { +# "ENGINE": os.environ.get("SQL_ENGINE", "django.contrib.gis.db.backends.postgis"), +# "NAME": os.environ.get("SQL_DATABASE", "tekdb"), +# "USER": os.environ.get("SQL_USER", "postgres"), +# "PASSWORD": os.environ.get("SQL_PASSWORD", ""), +# "HOST": ( +# os.environ.get("SQL_HOST") +# or os.environ.get("DB_HOST") +# or "localhost" +# ), +# "PORT": ( +# os.environ.get("SQL_PORT") +# or os.environ.get("DB_PORT") +# or "5432" +# ), # } # } diff --git a/TEKDB/TEKDB/settings.py b/TEKDB/TEKDB/settings.py index 52a0cb7b..f6f4e8c0 100644 --- a/TEKDB/TEKDB/settings.py +++ b/TEKDB/TEKDB/settings.py @@ -75,6 +75,7 @@ MIDDLEWARE = [ "django.middleware.security.SecurityMiddleware", + "whitenoise.middleware.WhiteNoiseMiddleware", "django.contrib.sessions.middleware.SessionMiddleware", "django.middleware.common.CommonMiddleware", "django.middleware.csrf.CsrfViewMiddleware", @@ -183,6 +184,10 @@ STATIC_ROOT = os.path.join(BASE_DIR, "static") +# Use WhiteNoise to serve static files when DEBUG is False (container / production) +STATICFILES_STORAGE = os.environ.get( + "STATICFILES_STORAGE", "whitenoise.storage.CompressedStaticFilesStorage" +) ########################################### ## FILEBROWSER ### ########################################### diff --git a/TEKDB/docker-compose.yml b/TEKDB/docker-compose.yml deleted file mode 100644 index 9b514d90..00000000 --- a/TEKDB/docker-compose.yml +++ /dev/null @@ -1,35 +0,0 @@ -version: '3.7' - -services: - app: - build: /usr/local/apps/TEKDB/TEKDB - command: dockerize -wait tcp://db:5432 sh -c "python manage.py runserver 0.0.0.0:8000" - volumes: - - ./:/usr/local/apps/TEKDB/TEKDB/ - - media_volume:/vol/web/media - - static_volume:/vol/web/static - ports: - - "8000:8000" - env_file: - - ./.env.dev - links: - - db - depends_on: - - db - environment: - - DEBUG=1 - db: - image: postgis/postgis:14-3.1-alpine - volumes: - - postgis-data:/var/lib/postgresql - environment: - - POSTGRES_USER=tekdb_user - - POSTGRES_PASSWORD=tekdb_password - - POSTGRES_DB=tekdb - ports: - - 5432:5432 - -volumes: - postgis-data: - static_volume: - media_volume: diff --git a/TEKDB/docker/entrypoint.sh b/TEKDB/docker/entrypoint.sh deleted file mode 100644 index b2eb0867..00000000 --- a/TEKDB/docker/entrypoint.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -#set -e -python manage.py collectstatic --noinput -python manage.py migrate --noinput -#python manage.py loaddata /usr/local/apps/TEKDB/TEKDB/TEKDB/fixtures/all_dummy_data.json -uwsgi --socket :8000 --master --enable-threads --module TEKDB.wsgi -#exec "$@" diff --git a/TEKDB/docker/local_settings.py b/TEKDB/docker/local_settings.py deleted file mode 100644 index 0056ff9f..00000000 --- a/TEKDB/docker/local_settings.py +++ /dev/null @@ -1,17 +0,0 @@ -TIME_ZONE = 'America/Los_Angeles' # To see all Timezone options, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List -REGISTRATION_OPEN = False -DATABASE_GEOGRAPHY = { - ###EPSG:4326### - # 'default_lon': -124.325, - # 'default_lat': 42.065, - ###EPSG:3857### - 'default_lon': -13839795.69, - 'default_lat': 5171448.926, - 'default_zoom': 8, - 'map_template': 'gis/admin/ol2osm.html', - 'map_extent': [-24000000, 1450000, -6200000, 13000000], #US Territories - 'min_zoom': 2, - 'max_zoom': 19, -} -STATIC_ROOT = '/vol/web/static' -MEDIA_ROOT = '/vol/web/media' diff --git a/TEKDB/entrypoint.sh b/TEKDB/entrypoint.sh new file mode 100644 index 00000000..fac43bbe --- /dev/null +++ b/TEKDB/entrypoint.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# Exit on errors +set -e + +# If a SQL_HOST is provided, wait for Postgres to become available before running +# migrations. This prevents race conditions when using docker-compose where the +# web container starts before the DB is ready. +if [ -n "$SQL_HOST" ]; then + echo "Waiting for database at ${SQL_HOST}:${SQL_PORT:-5432}..." + # pg_isready is available after installing postgresql-client in the image + until pg_isready -h "$SQL_HOST" -p "${SQL_PORT:-5432}" >/dev/null 2>&1; do + echo "Postgres is unavailable - sleeping" + sleep 1 + done + echo "Postgres is up" +fi + +echo "Collecting static files..." +python manage.py collectstatic --noinput +echo "Applying database migrations..." +python manage.py migrate --noinput +# Load default users only if no users exist +echo "Checking for existing users..." +if [ "$(python manage.py shell -c 'from django.contrib.auth import get_user_model; print(get_user_model().objects.count())')" = "0" ]; then + python manage.py loaddata TEKDB/fixtures/default_users_fixture.json +fi +# Load default lookups only if no lookups exist. Use LookupPlanningUnit as the check. +echo "Checking for existing lookups..." +if [ "$(python manage.py shell -c 'from TEKDB.models import LookupPlanningUnit; print(LookupPlanningUnit.objects.count())')" = "0" ]; then + python manage.py loaddata TEKDB/fixtures/default_lookups_fixture.json +fi + +if [ "$1" = "prod" ]; then + echo "Starting uWSGI (HTTP) on :8000" + uwsgi --http :8000 --master --enable-threads --module TEKDB.wsgi +elif [ "$1" = "dev" ]; then + echo "Starting python development server on :8000" + python manage.py runserver 0.0.0.0:8000 +else + # Default to the passed command if not 'prod' or 'dev' + exec "$@" +fi \ No newline at end of file diff --git a/TEKDB/explore/templatetags/disk_space_report.py b/TEKDB/explore/templatetags/disk_space_report.py index 96136c07..ff03f6e7 100644 --- a/TEKDB/explore/templatetags/disk_space_report.py +++ b/TEKDB/explore/templatetags/disk_space_report.py @@ -12,6 +12,7 @@ def bytes_to_readable(num_bytes, suffix="B"): return f"{num_bytes:.2f} {unit}{suffix}" num_bytes /= 1024 + @register.simple_tag(name="disk_space_report") def disk_space_report(): """Returns a dictionary with disk space and memory usage information.""" diff --git a/TEKDB/requirements.txt b/TEKDB/requirements.txt index 379d8440..276851e8 100644 --- a/TEKDB/requirements.txt +++ b/TEKDB/requirements.txt @@ -31,5 +31,8 @@ urllib3>=1.26.5 #OPTIONAL, BUT LOVELY FOR DEBUGGING ipdb ipython + +# Serve static files in production containers +whitenoise>=6.0.0,<7.0.0 # FORMATTING AND LINTING -ruff \ No newline at end of file +ruff diff --git a/docker/.env.dev b/docker/.env.dev new file mode 100644 index 00000000..e145b076 --- /dev/null +++ b/docker/.env.dev @@ -0,0 +1,9 @@ +DEBUG=1 +SECRET_KEY=foo +ALLOWED_HOSTS=localhost,127.0.0.1,[::1] +SQL_ENGINE=django.contrib.gis.db.backends.postgis +SQL_DATABASE=tekdb +SQL_USER=postgres +SQL_PASSWORD=tekdb_password +SQL_HOST=db +SQL_PORT=5432 diff --git a/docker/docker-compose.prod.yaml b/docker/docker-compose.prod.yaml new file mode 100644 index 00000000..872e7c53 --- /dev/null +++ b/docker/docker-compose.prod.yaml @@ -0,0 +1,46 @@ +services: + db: + image: postgis/postgis:15-3.4 + restart: always + platform: linux/amd64 + environment: + POSTGRES_DB: ${SQL_DATABASE} + POSTGRES_USER: ${SQL_USER} + POSTGRES_PASSWORD: ${SQL_PASSWORD} + volumes: + - tekdb_db_data:/var/lib/postgresql/data + ports: + - "5432:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${SQL_USER} -d ${SQL_DATABASE} -h localhost -p ${SQL_PORT}"] + interval: 10s + timeout: 5s + retries: 5 + + web: + build: + context: ../TEKDB/ + dockerfile: ../TEKDB/Dockerfile + command: ["prod"] + restart: unless-stopped + depends_on: + - db + env_file: + - .env.dev + environment: + ALLOWED_HOSTS: ${ALLOWED_HOSTS} + DEBUG: ${DEBUG} + SQL_ENGINE: ${SQL_ENGINE} + SQL_HOST: ${SQL_HOST} + SQL_PORT: ${SQL_PORT} + SQL_DATABASE: ${SQL_DATABASE} + SQL_USER: ${SQL_USER} + SQL_PASSWORD: ${SQL_PASSWORD} + SECRET_KEY: ${SECRET_KEY} + ports: + - "8000:8000" + volumes: + - ../TEKDB:/usr/src/app + +volumes: + tekdb_db_data: diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..f865e83a --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,45 @@ +services: + db: + image: postgis/postgis:15-3.4 + restart: always + platform: linux/amd64 + environment: + POSTGRES_DB: ${SQL_DATABASE} + POSTGRES_USER: ${SQL_USER} + POSTGRES_PASSWORD: ${SQL_PASSWORD} + volumes: + - tekdb_db_data:/var/lib/postgresql/data + ports: + - "5432:5432" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U ${SQL_USER} -d ${SQL_DATABASE} -h localhost -p ${SQL_PORT}"] + interval: 10s + timeout: 5s + retries: 5 + + web: + build: + context: ../TEKDB/ + dockerfile: ../TEKDB/Dockerfile + restart: unless-stopped + depends_on: + - db + env_file: + - .env.dev + environment: + ALLOWED_HOSTS: ${ALLOWED_HOSTS} + DEBUG: ${DEBUG} + SQL_ENGINE: ${SQL_ENGINE} + SQL_HOST: ${SQL_HOST} + SQL_PORT: ${SQL_PORT} + SQL_DATABASE: ${SQL_DATABASE} + SQL_USER: ${SQL_USER} + SQL_PASSWORD: ${SQL_PASSWORD} + SECRET_KEY: ${SECRET_KEY} + ports: + - "8000:8000" + volumes: + - ../TEKDB:/usr/src/app + +volumes: + tekdb_db_data: diff --git a/docker/linux/.env b/docker/linux/.env deleted file mode 100644 index 8fa814aa..00000000 --- a/docker/linux/.env +++ /dev/null @@ -1,126 +0,0 @@ -##################### -# REQUIRED SETTINGS # -##################### - -# These settings must absolutely be changed for any production deployment. -# Most of these are critical to the security of your database application. -# Many of these settings should be changed even for development environments. - -## SECRET_KEY: -## Used to secure the app. Can be anything -- feel free to hammer out -## a long line of numbers, letters, caps, and symbols. You will not need -## to remember or retype this ever. -SECRET_KEY=changeme - -## PROXY_PORT: -## The port the proxy server (NGINX) will serve the application on. Use 80 in -## production for HTTP or 443 for HTTPS. For dev you may prefer 80xx. -PROXY_PORT=8000 - -## ALLOWED_HOSTS: -## List of web addresses server will accept traffic from. This can be an -## IP address (127.0.0.1) or a URL (your.site.com). Separate addresses with a -## comma (no spaces). Leave the current default addresses in place unless -## you know what you're doing. -ALLOWED_HOSTS=localhost,127.0.0.1,[::1] - -## SQL_DATABASE: -## The name of your database. This can be any word (no spaces). You can leave -## the default in place, but you will get extra security by making it unique. -SQL_DATABASE=itkdb - -## SQL_USER: -## A username for the owner of your database. Can be any word (no spaces). -## It is recommended that you change this for security purposes -SQL_USER=itkdb_user - -## SQL_PASSWORD: -## A password for your database user. Can be any word (no spaces). You -## absolutely MUST change this password before you put any sensitive -## information in your database -SQL_PASSWORD=tekdb_password - -## DEFAULT_LON, DEFAULT_LAT: -## The longitudinal (LON) and latitudinal (LAT) coordinate of the geographic -## center of your region of interest. -## Unfortunately it must also be expressed in Web Mercator -## (EPSG:3857) coordinate projection. If you know your coordinates in the -## most common form (EPSG:4326 WGS 84, will look something like -## "-120.123, 40.123") you can make the conversion at this site: -## https://epsg.io/transform#s_srs=4326&t_srs=3857 -DEFAULT_LON=-13839795.69 -DEFAULT_LAT=5171448.926 - -## DEFAULT_ZOOM: -## A numeric representation for the default map scale provided when your -## region of interest is presented on a map. Here is a rough outline of -## what scale the numbers show: -## - 0: the whole world -## - 3: The U.S.A. or a small continent -## - 6: A medium-large U.S. state -## - 10: A county -## - 12: A forest -DEFAULT_ZOOM=8 - -################### -# SERVER SETTINGS # -################### - -# These are settings that may impact how the application is served. These should -# only be important for development or highly-customized deployments. - -## DEBUG: -## Set to 1 for 'true' if you are actively modifying the code base -## Leave as 0 for 'false' (default) for running in production -DEBUG=0 - -## ADMIN_SITE_HEADER: -## The title of the application shown at the top of the Admin Data-Entry -## pages. -ADMIN_SITE_HEADER=ITK DB Admin - -## TIME_ZONE: -## To see all Timezone options, see -## https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List -TIME_ZONE=America/Los_Angeles - -##################### -# DATABASE SETTINGS # -##################### - -# These are the default settings for connecting the application to the -# database. They most likely should not be changed, and only then in -# experimental development of highly-customized deployments. The descriptions -# will assume a high-familiarity with the subject matter, particularly of -# Django, RDBMSs, networking, and Docker. - -## SQL_ENGINE: -## The django database backend to use to connect to the database. -SQL_ENGINE=django.contrib.gis.db.backends.postgis - -## SQL_HOST: -## The network address of the database. The default 'db' is the variable name -## assigned and recognized by Docker from your docker-compose.yml file. -SQL_HOST=db - -## SQL_PORT: -## The port your database is accepting connections on. Default for PostgreSQL -## is 5432. -SQL_PORT=5432 - -################ -# MAP SETTINGS # -################ - -# These allow for additional customization of map behavior. - -## MAP_EXTENT_[WEST/SOUTH/EAST/NORTH]: -## These 4 settings set the extent to which the web map can be moved. They are -## coordinates expressed in the projection EPSG:3857 (Web Mercator). -## These values do not represent the extent of your region of interest -- -## they should be far greater. By default it is set large enough to cover all -## current US landmasses, including territories. -MAP_EXTENT_WEST=-24000000 -MAP_EXTENT_SOUTH=1450000 -MAP_EXTENT_EAST=-6200000 -MAP_EXTENT_NORTH=13000000 diff --git a/docker/linux/Dockerfile b/docker/linux/Dockerfile deleted file mode 100644 index 271f67b9..00000000 --- a/docker/linux/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# pull official base image -#FROM python:3.9.6-alpine -FROM python:3.8.10-alpine - -# set environment variables -ENV PYTHONDONTWRITEBYTECODE 1 -ENV PYTHONUNBUFFERED 1 - -COPY ./requirements.txt . - -# install dependencies -RUN \ - apk update &&\ - apk add --no-cache --virtual .build-deps \ - python3-dev musl-dev gcc \ - binutils \ - postgresql-dev postgresql-libs \ - libffi-dev \ - pkgconfig openssl &&\ - apk add --no-cache --update \ - libpq gdal-dev && \ - pip install --upgrade pip &&\ - pip install -r requirements.txt &&\ - apk --purge del .build-deps - -# copy project -COPY ./ /usr/local/apps/TEKDB/TEKDB -COPY ./docker/entrypoint.sh /entrypoint.sh - -# set work directory -WORKDIR /usr/local/apps/TEKDB/TEKDB - -RUN chmod +x /entrypoint.sh - -RUN mkdir -p /vol/web/media -RUN mkdir -p /vol/web/static - -RUN adduser -D tekdb_user -RUN chown -R tekdb_user:tekdb_user /vol -RUN chmod -R 755 /vol/web - -USER tekdb_user - -CMD ["/entrypoint.sh"] diff --git a/docker/linux/docker-compose.yml b/docker/linux/docker-compose.yml deleted file mode 100644 index 109b84fe..00000000 --- a/docker/linux/docker-compose.yml +++ /dev/null @@ -1,60 +0,0 @@ -version: '3.7' - -services: - app: - build: - context: ../../TEKDB - # command: dockerize -wait tcp://db:5432 sh -c "python manage.py migrate --noinput" - # command: dockerize -wait tcp://db:5432 sh -c "python manage.py loaddata /usr/local/apps/TEKDB/TEKDB/TEKDB/fixtures/all_dummy_data.json" - volumes: - - static_data:/vol/web - environment: - - SECRET_KEY=${SECRET_KEY} - - ALLOWED_HOSTS=${ALLOWED_HOSTS} - - SQL_ENGINE=${SQL_ENGINE} - - SQL_DATABASE=${SQL_DATABASE} - - SQL_USER=${SQL_USER} - - SQL_PASSWORD=${SQL_PASSWORD} - - SQL_HOST=${SQL_HOST} - - SQL_PORT=${SQL_PORT} - depends_on: - - ${SQL_HOST} - links: - - ${SQL_HOST} - networks: - - djangonetwork - - proxy: - build: - context: ../../proxy - volumes: - - static_data:/vol/static - # - media_data:/vol/media - ports: - - "${PROXY_PORT}:8080" - depends_on: - - app - networks: - - djangonetwork - - db: - image: postgis/postgis:14-3.1-alpine - volumes: - - postgis-data:/var/lib/postgresql - environment: - - POSTGRES_USER=${SQL_USER} - - POSTGRES_PASSWORD=${SQL_PASSWORD} - - POSTGRES_DB=${SQL_DATABASE} - ports: - - ${SQL_PORT}:5432 - networks: - - djangonetwork - -volumes: - postgis-data: - static_data: - # media_data: - -networks: - djangonetwork: - driver: bridge diff --git a/docker/windows/.env b/docker/windows/.env deleted file mode 100644 index 8fa814aa..00000000 --- a/docker/windows/.env +++ /dev/null @@ -1,126 +0,0 @@ -##################### -# REQUIRED SETTINGS # -##################### - -# These settings must absolutely be changed for any production deployment. -# Most of these are critical to the security of your database application. -# Many of these settings should be changed even for development environments. - -## SECRET_KEY: -## Used to secure the app. Can be anything -- feel free to hammer out -## a long line of numbers, letters, caps, and symbols. You will not need -## to remember or retype this ever. -SECRET_KEY=changeme - -## PROXY_PORT: -## The port the proxy server (NGINX) will serve the application on. Use 80 in -## production for HTTP or 443 for HTTPS. For dev you may prefer 80xx. -PROXY_PORT=8000 - -## ALLOWED_HOSTS: -## List of web addresses server will accept traffic from. This can be an -## IP address (127.0.0.1) or a URL (your.site.com). Separate addresses with a -## comma (no spaces). Leave the current default addresses in place unless -## you know what you're doing. -ALLOWED_HOSTS=localhost,127.0.0.1,[::1] - -## SQL_DATABASE: -## The name of your database. This can be any word (no spaces). You can leave -## the default in place, but you will get extra security by making it unique. -SQL_DATABASE=itkdb - -## SQL_USER: -## A username for the owner of your database. Can be any word (no spaces). -## It is recommended that you change this for security purposes -SQL_USER=itkdb_user - -## SQL_PASSWORD: -## A password for your database user. Can be any word (no spaces). You -## absolutely MUST change this password before you put any sensitive -## information in your database -SQL_PASSWORD=tekdb_password - -## DEFAULT_LON, DEFAULT_LAT: -## The longitudinal (LON) and latitudinal (LAT) coordinate of the geographic -## center of your region of interest. -## Unfortunately it must also be expressed in Web Mercator -## (EPSG:3857) coordinate projection. If you know your coordinates in the -## most common form (EPSG:4326 WGS 84, will look something like -## "-120.123, 40.123") you can make the conversion at this site: -## https://epsg.io/transform#s_srs=4326&t_srs=3857 -DEFAULT_LON=-13839795.69 -DEFAULT_LAT=5171448.926 - -## DEFAULT_ZOOM: -## A numeric representation for the default map scale provided when your -## region of interest is presented on a map. Here is a rough outline of -## what scale the numbers show: -## - 0: the whole world -## - 3: The U.S.A. or a small continent -## - 6: A medium-large U.S. state -## - 10: A county -## - 12: A forest -DEFAULT_ZOOM=8 - -################### -# SERVER SETTINGS # -################### - -# These are settings that may impact how the application is served. These should -# only be important for development or highly-customized deployments. - -## DEBUG: -## Set to 1 for 'true' if you are actively modifying the code base -## Leave as 0 for 'false' (default) for running in production -DEBUG=0 - -## ADMIN_SITE_HEADER: -## The title of the application shown at the top of the Admin Data-Entry -## pages. -ADMIN_SITE_HEADER=ITK DB Admin - -## TIME_ZONE: -## To see all Timezone options, see -## https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List -TIME_ZONE=America/Los_Angeles - -##################### -# DATABASE SETTINGS # -##################### - -# These are the default settings for connecting the application to the -# database. They most likely should not be changed, and only then in -# experimental development of highly-customized deployments. The descriptions -# will assume a high-familiarity with the subject matter, particularly of -# Django, RDBMSs, networking, and Docker. - -## SQL_ENGINE: -## The django database backend to use to connect to the database. -SQL_ENGINE=django.contrib.gis.db.backends.postgis - -## SQL_HOST: -## The network address of the database. The default 'db' is the variable name -## assigned and recognized by Docker from your docker-compose.yml file. -SQL_HOST=db - -## SQL_PORT: -## The port your database is accepting connections on. Default for PostgreSQL -## is 5432. -SQL_PORT=5432 - -################ -# MAP SETTINGS # -################ - -# These allow for additional customization of map behavior. - -## MAP_EXTENT_[WEST/SOUTH/EAST/NORTH]: -## These 4 settings set the extent to which the web map can be moved. They are -## coordinates expressed in the projection EPSG:3857 (Web Mercator). -## These values do not represent the extent of your region of interest -- -## they should be far greater. By default it is set large enough to cover all -## current US landmasses, including territories. -MAP_EXTENT_WEST=-24000000 -MAP_EXTENT_SOUTH=1450000 -MAP_EXTENT_EAST=-6200000 -MAP_EXTENT_NORTH=13000000