summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: 6eeed16da23f7b965e6866acf44aeb2343faf0d5 (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
version: '4.1'

services:
  app:
    build:
      dockerfile: Dockerfile
      context: .
    volumes:
      - .:/app
    environment:
      POSTGRES_CONNECTION_STRING: "postgresql://app:app@db:5432/app"
    depends_on:
      db:
        condition: service_healthy
    ports:
      - 8000:8000

  db:
    image: postgres
    restart: always
    environment:
      POSTGRES_USER: app
      POSTGRES_PASSWORD: app
      POSTGRES_DB: app
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U app -d app"]
      interval: 3s
      timeout: 10s
      retries: 3