# Dependency Services

# DB

For now, we only recommend Postgres as db service.

  1. If you are using Mac, you can setup Postgres service using Postgres.app (opens new window)
  2. If you are using Linux, you can use apt-get install or docker

# Redis

$ docker run --rm -p 6379:6379 -d redis

# Mailhog

Mailhog can help us check email content, and the style on local.

$ docker run --rm -d -p 1025:1025 -p 8025:8025 mailhog/mailhog

# Docker Compose solution

Use local.yml to let people launch dependency services using one command docker-compose -f local.yml up

version: '3.7'
services:
  db:
    image: postgres:13
    volumes:
      - postgres_data:/var/lib/postgresql/data/
    ports:
      - 5432:5432
    environment:
      # DATABASE_URL=postgres://postgres:[email protected]:5432/django_app
      - POSTGRES_DB=django_app
      - POSTGRES_PASSWORD=postgres

  redis:
    image: redis:7-alpine
    ports:
      - 6379:6379

  mailhog:
    image: mailhog/mailhog
    ports:
      - 1025:1025 # smtp server
      - 8025:8025 # web ui

volumes:
  postgres_data: