Skip to content

Local Development with Docker

paigewilliams edited this page Dec 18, 2025 · 2 revisions

Set up

Prerequisites

  • Install Docker Desktop (mac, [linux] (https://docs.docker.com/desktop/setup/install/linux/))
  • Create a local_settings.py from local_settings.py.template in /TEKDB
  • Optional: Set up and activate your preferred python virtual environment (ex: venv, pyenv, uv). This is helpful to run ruff commands.

Running the dev server

  • Navigate to the docker directory: cd docker/
  • Start the postgres and django containers: docker compose up --build Optional: add -d to run detached. Logs then are visible in the Docker Desktop app.
  • The django dev server is spun up at port 8000, allowing for reloads during development.
  • To stop the server: docker compose down

Running the production server

  • Navigate to the docker directory: cd docker/
  • Start the postgres and django containers in production mode: docker compose -f docker-compose.prod.yaml up -d --build .
  • A uwsgi server is spun up at port 8000

Testing

  • Exec into the container to run tests: exec -it <web-server-name> python manage.py test

Formatting

  • From your python virtual environment, cd TEKDB/ and install dependencies pip install -r requirements.txt
  • Run ruff format

Clone this wiki locally