summaryrefslogtreecommitdiff
path: root/docker-compose.yml
blob: 02ed34a623d70b9f4ca4f45f530622e3f59a94e5 (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
version: '3.8'
services:
  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    ports:
      - 3000:80
    depends_on:
      - backend
  backend:
    build:
      context: ./backend
      dockerfile: Dockerfile
    ports:
      - 3001:80
    depends_on:
      database:
        condition: service_healthy
  database:
    image: postgres:latest
    restart: always
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: elements
      POSTGRES_PASSWORD: elementspass
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U elements"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  db-data: