aboutsummaryrefslogtreecommitdiffstats
path: root/compose.yml
blob: 7fae4b0612451e0215e92744033fdf170fbd48d4 (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
services:
  db:
    image: postgres:14
    environment:
      POSTGRES_DB: db
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "54321:5432"
    volumes:
      - db-data:/var/lib/postgresql/data
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U postgres']
      interval: 5s
      timeout: 5s
      retries: 5

  web:
    build: .
    environment:
      BASE_URL: http://localhost:8000
      DB_PASSWORD: postgres
      DB_HOST: db
    ports:
      - "8000:8000"
    depends_on:
      db:
        condition: service_healthy

volumes:
  db-data: