● Zion Boggan
repos/Sightline/docker-compose.yml
zionboggan.com ↗
83 lines · yaml
History for this file →
1
services:
2
  postgres:
3
    image: postgres:16
4
    environment:
5
      POSTGRES_USER: sightline
6
      POSTGRES_PASSWORD: sightline
7
      POSTGRES_DB: sightline
8
    ports:
9
      - "5432:5432"
10
    volumes:
11
      - pgdata:/var/lib/postgresql/data
12
    healthcheck:
13
      test: ["CMD-SHELL", "pg_isready -U sightline"]
14
      interval: 5s
15
      timeout: 3s
16
      retries: 10
17
 
18
  redis:
19
    image: redis:7-alpine
20
    ports:
21
      - "6379:6379"
22
    healthcheck:
23
      test: ["CMD", "redis-cli", "ping"]
24
      interval: 5s
25
      timeout: 3s
26
      retries: 10
27
 
28
  api:
29
    build: ./backend
30
    command: ["bash", "entrypoint.sh"]
31
    environment:
32
      SIGHTLINE_DATABASE_URL: postgresql+psycopg2://sightline:sightline@postgres:5432/sightline
33
      SIGHTLINE_REDIS_URL: redis://redis:6379/0
34
      SIGHTLINE_SECRET_KEY: ${SIGHTLINE_SECRET_KEY:-dev-insecure-change-me}
35
      SIGHTLINE_STORAGE_DIR: /data/storage
36
      SIGHTLINE_SEED: "true"
37
    volumes:
38
      - storage:/data/storage
39
    ports:
40
      - "8000:8000"
41
    depends_on:
42
      postgres:
43
        condition: service_healthy
44
      redis:
45
        condition: service_healthy
46
 
47
  worker:
48
    build: ./backend
49
    command: ["celery", "-A", "app.workers.celery_app.celery_app", "worker", "--loglevel=info"]
50
    environment:
51
      SIGHTLINE_DATABASE_URL: postgresql+psycopg2://sightline:sightline@postgres:5432/sightline
52
      SIGHTLINE_REDIS_URL: redis://redis:6379/0
53
      SIGHTLINE_STORAGE_DIR: /data/storage
54
    volumes:
55
      - storage:/data/storage
56
    depends_on:
57
      postgres:
58
        condition: service_healthy
59
      redis:
60
        condition: service_healthy
61
 
62
  beat:
63
    build: ./backend
64
    command: ["celery", "-A", "app.workers.celery_app.celery_app", "beat", "--loglevel=info"]
65
    environment:
66
      SIGHTLINE_DATABASE_URL: postgresql+psycopg2://sightline:sightline@postgres:5432/sightline
67
      SIGHTLINE_REDIS_URL: redis://redis:6379/0
68
    depends_on:
69
      redis:
70
        condition: service_healthy
71
 
72
  frontend:
73
    build: ./frontend
74
    environment:
75
      NEXT_PUBLIC_API_BASE: http://localhost:8000/api/v1
76
    ports:
77
      - "3000:3000"
78
    depends_on:
79
      - api
80
 
81
volumes:
82
  pgdata:
83
  storage: