Advertisement
eliasprado

docker compose multi tenant

Apr 12th, 2022
1,586
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. version: '3'
  2.  
  3.   # Thor
  4.   thor_db:
  5.     image: postgres
  6.     environment:
  7.       - POSTGRES_PASSWORD=thor
  8.       - POSTGRES_USER=thor
  9.       - POSTGRES_DB=thor
  10.   thor_web:
  11.     image: multi-tenant
  12.     command: python3 manage.py runserver 0.0.0.0:8000
  13.     volumes:
  14.       - .:/code
  15.     depends_on:
  16.       - thor_db
  17.     environment:
  18.       - DATABASE_URL=postgres://thor:thor@thor_db/thor
  19.  
  20.   thor_migration:
  21.     image: multi-tenant
  22.     command: python3 manage.py migrate
  23.     volumes:
  24.       - .:/code
  25.     depends_on:
  26.       - thor_db
  27.     environment:
  28.       - DATABASE_URL=postgres://thor:thor@thor_db/thor
  29. # -------------------------------------------------------------------------------------------------------------------
  30.   # Potter
  31.   potter_db:
  32.     image: postgres
  33.     environment:
  34.       - POSTGRES_PASSWORD=potter
  35.       - POSTGRES_USER=potter
  36.       - POSTGRES_DB=potter
  37.   potter_web:
  38.     image: multi-tenant
  39.     command: python3 manage.py runserver 0.0.0.0:8000
  40.     volumes:
  41.       - .:/code
  42.     depends_on:
  43.       - potter_db
  44.     environment:
  45.       - DATABASE_URL=postgres://potter:potter@potter_db/potter
  46.  
  47.   potter_migration:
  48.     image: multi-tenant
  49.     command: python3 manage.py migrate
  50.     volumes:
  51.       - .:/code
  52.     depends_on:
  53.       - thor_db
  54.     environment:
  55.       - DATABASE_URL=postgres://potter:potter@potter_db/potter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement