docker-compose.yaml 563 Bytes
Newer Older
1
2
3
4
5
version: "3.7"
services:
  backend:
    build: backend
    ports:
6
      - 8080:8080
7
    environment:
8
      - POSTGRES_DB=example
9
    networks:
10
      - spring-postgres
11
12
13
14
  db:
    image: postgres
    restart: always
    secrets:
15
      - db-password
16
    volumes:
17
      - db-data:/var/lib/postgresql/data
18
    networks:
19
      - spring-postgres
20
21
22
    environment:
      - POSTGRES_DB=example
      - POSTGRES_PASSWORD_FILE=/run/secrets/db-password
23
24
    expose:
      - 5432
25
volumes:
26
  db-data:
27
28
29
secrets:
  db-password:
    file: db/password.txt
30
networks:
31
  spring-postgres: