aboutsummaryrefslogtreecommitdiff
path: root/.devcontainer/pgsql/docker-compose.yaml
blob: 45af0b33e1ee7cc70f0203a3bc7efe416dca1c68 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile

    volumes:
      - ../../..:/workspaces:cached

    # Overrides default command so things don't shut down after the process ends.
    command: sleep infinity

    # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
    network_mode: service:pgadmin
    # Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
    # user: root

    # Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
    # (Adding the "ports" property to this file will not forward from a Codespace.)

  db:
    image: postgres:17.2
    restart: unless-stopped
    volumes:
      - ./pgdata:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: jellyfin
      POSTGRES_USER: jellyfin
      POSTGRES_DB: Jellyfin
  pgadmin:
    image: dpage/pgadmin4
    restart: unless-stopped
    volumes:
      - ./pgadmin:/pgadmin
      - pgadmin-data:/var/lib/pgadmin
    environment:
      - PGADMIN_DEFAULT_EMAIL=user@domain.com
      - PGADMIN_DEFAULT_PASSWORD=SuperSecret
      - PGADMIN_LISTEN_PORT=8081
      - PGADMIN_SERVER_JSON_FILE=/pgadmin/servers.json
      - PGADMIN_CONFIG_SERVER_MODE=False
    # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
    # (Adding the "ports" property to this file will not forward from a Codespace.)

volumes:
  pgadmin-data: