summaryrefslogtreecommitdiffstats
path: root/docker/docker-compose.yml
blob: 3949f56e84c84ed31e397521a3f39f16826a6018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: "3.4"

# DO NOT USE THIS IN PRODUCTION - it is for development only due to insecure
# settings and the use of "runserver" versus "gunicorn".
# See https://takahe-server.readthedocs.io/en/latest/installation.html for more

x-takahe-common:
  &takahe-common
    build:
      context: ..
      dockerfile: ./docker/Dockerfile

    image: takahe:latest
    environment:
      TAKAHE_DATABASE_URL: "postgres://postgres:insecure_password@db/takahe"
      TAKAHE_DEBUG: true
      TAKAHE_SECRET_KEY: "insecure_secret"
      TAKAHE_CSRF_TRUSTED_ORIGINS: '["http://127.0.0.1:8000", "https://127.0.0.1:8000"]'
      TAKAHE_USE_PROXY_HEADERS: true
      TAKAHE_EMAIL_BACKEND: "console://console"
      TAKAHE_MAIN_DOMAIN: "example.com"
      TAKAHE_ENVIRONMENT: "development"
    networks:
      - external_network
      - internal_network
    restart: on-failure
    depends_on:
      - db
    volumes:
      - ..:/takahe/

services:
  db:
    image: postgres:15-alpine
    healthcheck:
      test: ['CMD', 'pg_isready', '-U', 'postgres']
    volumes:
      - dbdata:/var/lib/postgresql/data
    networks:
      - internal_network
    restart: always
    environment:
      POSTGRES_DB: takahe
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: insecure_password

  web:
    <<: *takahe-common
    ports:
      - "8000:8000"

  setup:
    <<: *takahe-common
    command: ["/takahe/manage.py", "migrate"]

networks:
  internal_network:
  external_network:

volumes:
  dbdata: