aboutsummaryrefslogtreecommitdiff
blob: df134574a324ee89d500920a78dc3338a849aec3 (about) (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
services:
  http-serving:
    image: ${SOKO_IMAGE:-docker.io/gentoo/soko:latest}
    volumes:
      - type: "bind"
        source: "/var/log/soko"
        target: "/var/log/soko"
    ports:
      - 127.0.0.1:5000:5000
    labels:
      com.centurylinklabs.watchtower.enable: "true"
    restart: always
    environment:
      SOKO_LOG_FILE: '/var/log/soko/web.log'
    depends_on:
      - db
    mem_limit: 4G
  updater:
    image: ${SOKO_UPDATER_IMAGE:-docker.io/gentoo/soko-updater:latest}
    volumes:
      - type: "bind"
        source: "/mnt/packages-tree"
        target: "/mnt/packages-tree"
      - type: "bind"
        source: "/var/log/soko"
        target: "/var/log/soko"
    labels:
      com.centurylinklabs.watchtower.enable: "true"
    environment:
      SOKO_LOG_FILE: '/var/log/soko/updater.log'
      SOKO_GITHUB_TOKEN: '${SOKO_GITHUB_TOKEN}'
      SOKO_CODEBERG_TOKEN: '${SOKO_CODEBERG_TOKEN}'
    depends_on:
      - db
  db:
    image: docker.io/postgres:17
    restart: always
    environment:
      POSTGRES_USER: ${SOKO_POSTGRES_USER:-root}
      POSTGRES_PASSWORD: ${SOKO_POSTGRES_PASSWORD:-root}
      POSTGRES_DB: ${SOKO_POSTGRES_DB:-soko}
    shm_size: 512mb
    volumes:
      - ${POSTGRES_DATA_PATH:-/var/lib/postgresql/data}:/var/lib/postgresql/data
  watchtower:
    image: docker.io/containrrr/watchtower:1.7.1
    restart: always
    volumes:
    # docker has an issue, that if it mounts a socket directly, upon daemon restart,
    # the socket is recreated and the new one isn't mounted. Mounting the whole /var/run
    # directory is scatchy, so add another socket position for the daemon to create, and
    # bind mount it. Add to docker daemon those args:
    #   --host=unix:///var/run/docker.sock --host=unix:///var/run/docker-watchtower/docker.sock
      - /var/run/docker-watchtower:/var/run/docker-watchtower
      - /root/.docker/config.json:/config.json
    command:
      - --label-enable
      - --include-stopped
      - --cleanup
      - --schedule
      - "0 0 * * * *"
      - --host
      - unix:///var/run/docker-watchtower/docker.sock