Skip to content

add bash script to install docker and TEKDB on Linux#297

Merged
paigewilliams merged 8 commits into
developfrom
docker-install-script
Jun 23, 2026
Merged

add bash script to install docker and TEKDB on Linux#297
paigewilliams merged 8 commits into
developfrom
docker-install-script

Conversation

@paigewilliams

Copy link
Copy Markdown
Collaborator

Work in progress! Writing a bash script to run on Linux to install docker and the TEKDB repo, and start the docker containers.

How to test:

  1. Create a .env.prod file with your environment variables in an accessible location on your Linux instance. .env.prod should contain the following environment variables
   
SECRET_KEY= # a random 50+ character string used for Django.You can generate this yourself or use a tool like [this](https://builtwithdjango.com/tools/django-secret/) to generate one for you.
ALLOWED_HOSTS= # IP address you want the app to run on 
SQL_ENGINE=django.contrib.gis.db.backends.postgis
SQL_DATABASE= # database name, ex: tekdb
SQL_USER= #database user, ex: postgres
SQL_PASSWORD= # database password
SQL_HOST=db
SQL_PORT=5432
WEB_IMAGE=ghcr.io/ecotrust/tekdb/web 
CELERY_BROKER_URL=redis://redis:6379/0
GIS_USER_PASSWORD= # password for user named ‘gis’ which has permissions for accessing tables with spatial data
  1. Copy the scripts/Linux/install-docker-env.sh file to an accessible location on your Linux instance. Run ./install-docker-env.sh <file path to env.prod file>

  2. View the TEKDB application running on your specified IP address!

@paigewilliams paigewilliams requested a review from rhodges June 15, 2026 22:40
@paigewilliams paigewilliams self-assigned this Jun 15, 2026
@rhodges

rhodges commented Jun 18, 2026

Copy link
Copy Markdown
Member

Ran through the script with @paigewilliams yesterday:

  • Script ran, successfully installed and served the app, and supported uploading/downloading/media/etc...
  • Fixes to be considered:
    • The script should halt immediately if no config file is shared via CLI
    • The script reporting failing/error due to embedded error messages in django app complaining of absent local_settings.py file
      • Since the actual code completed, the script status should probably not have reported this as an error
      • The underlaying code should handle the case of a missing local_settings.py file more gracefully
    • Despite running NGINX:
      • the recommended process (using port 8000) bypasses NGINX and hits uWSGI directly
        • This is not recommended, nor suitable for deployment
      • NGINX was not properly configured to serve the app
      • NGINX was not serving to port 80
        • 80 should be default, but configurable via the .env (or other) file, as this may be installed on a computer that already runs a different server on port 80 (example - this default would have failed on my workstation)

@rhodges rhodges left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See prior comment about the few things that didn't work quite right. All in all this is an amazing accomplishment with very little left to finish.

@paigewilliams

Copy link
Copy Markdown
Collaborator Author

@rhodges, if you are curious this commit solved the issue of not using nginx!

depends_on:
- web
ports:
- "80:8080"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you have container 8080 going to host 80, I recommend deleting the 8080:8080 line.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good call! done!

@paigewilliams

Copy link
Copy Markdown
Collaborator Author

Started docs here for installing with docker using these scripts.

@paigewilliams paigewilliams merged commit 367f354 into develop Jun 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants