Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 2.09 KB

File metadata and controls

103 lines (78 loc) · 2.09 KB

Docker Development Environment

Quick Start

  1. Copy environment file:

    cp .env.example .env
  2. Build and start services:

    docker-compose up --build
  3. Run migrations (in another terminal):

    docker-compose exec web python manage.py migrate
  4. Create superuser (optional):

    docker-compose exec web python manage.py createsuperuser
  5. Access the application:

Services

  • web: Django application (Python 2.7 + Django 1.8)
  • db: PostgreSQL 12
  • redis: Redis 6 (for Celery)
  • elasticsearch: Elasticsearch 1.7.6 (matching original version)

Common Commands

Start services

docker-compose up

Start in background

docker-compose up -d

Stop services

docker-compose down

View logs

docker-compose logs -f web

Run Django commands

docker-compose exec web python manage.py <command>

Run tests

docker-compose exec web py.test tests/

Access Django shell

docker-compose exec web python manage.py shell

Rebuild after dependency changes

docker-compose build web
docker-compose up

Access database directly

docker-compose exec db psql -U hellobase -d hellobase

Troubleshooting

Port already in use

If port 8001, 5432, 6379, or 9200 is already in use, edit docker-compose.yml to change the port mapping.

Database connection issues

Ensure the DATABASE_URL in .env matches the docker-compose.yml configuration.

Elasticsearch not starting

Elasticsearch 1.7.6 may require more memory. Increase Docker's memory limit in Docker Desktop settings.

Upgrade Process

As we progress through Django upgrades, the Dockerfile will be updated to reflect:

  • Hop 1: Still Python 2.7, Django 1.11
  • Hop 2: Python 3.11+, Django 1.11
  • Hop 3+: Python 3.11+, Django 2.2 → 4.2

Each hop will be tested in this Docker environment before committing changes.