aboutsummaryrefslogtreecommitdiffstats
path: root/docker-compose.yml
blob: f92f00608815c6d2691a47c7fc5c28e5a14e70e3 (plain) (blame)
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
62
63
64
services:
  postgres:
    restart: unless-stopped
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: thallium
      POSTGRES_PASSWORD: thallium
      POSTGRES_USER: thallium
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U thallium"]
      interval: 2s
      timeout: 1s
      retries: 5
    ports:
      - "15432:5432"

  thallium-backend:
    build:
      context: thallium-backend
      cache_from:
        - type=registry,ref=ghcr.io/owl-corp/thallium-backend:latest
    restart: unless-stopped
    command: ["alembic upgrade head && uvicorn src.app:fastapi_app --host 0.0.0.0 --port 8000 --reload --no-server-header"]
    volumes:
      - ./thallium-backend/migrations:/thallium/migrations:ro
      - ./thallium-backend/src:/thallium/src:ro
    env_file:
      - .env
    environment:
      BACKEND_DATABASE_URL: postgresql+psycopg_async://thallium:thallium@postgres:5432/thallium
      BACKEND_TOKEN: suitable-for-development-only
      BACKEND_APP_PREFIX: /api
      BACKEND_SIGNING_KEY: super-secure-key
    ports:
      - "8000:8000"
    depends_on:
      postgres:
        condition: service_healthy

  thallium-frontend:
    build:
      context: thallium-frontend
      dockerfile: Dockerfile.development
      cache_from:
        - type=registry,ref=ghcr.io/owl-corp/thallium-frontend:latest
    restart: unless-stopped
    volumes:
      # Once https://github.com/vitejs/vite/issues/9470 has a nice solution, we can make the mount read-only
      - ./thallium-frontend:/app
      - /app/node_modules
    ports:
      - "5173:5173"

  thallium-caddy:
    image: caddy:2-alpine
    restart: unless-stopped
    volumes:
      - ./thallium-caddy/Caddyfile:/etc/caddy/Caddyfile:ro
      - ./thallium-caddy/data:/data
    ports:
      - "80:80"
    depends_on:
      - thallium-backend
      - thallium-frontend