WSL/SLF GitLab Repository

docker-compose.yml 2.09 KB
Newer Older
Sam's avatar
Sam committed
1
2
3
4
5
6
7
version: "3"

volumes:
  ckan_storage:
  pg_data:
  solr_data:

Sam's avatar
Sam committed
8
9
10
secrets:
  ckan_config:
    file: ./${CKAN_CONFIG_FILE:-/dev/null}
Sam's avatar
Sam committed
11
12
13
14
15
16
  db_init_pass:
    file: ./${CKAN_DB_INIT_PASS_FILE:-/dev/null}
  db_env_secret:
    file: ./${CKAN_DB_SECRET_FILE:-/dev/null}
  solr_creds:
    file: ./${CKAN_SOLR_CREDS_FILE:-/dev/null}
Sam's avatar
Sam committed
17
18
19
20
21

networks:
  ckan-internal:
    external: true

Sam's avatar
Sam committed
22
23
24
services:
  ckan:
    container_name: ckan
Sam's avatar
Sam committed
25
    image: "${INTERNAL_REG}/ckan:${CKAN_VERSION}"
Sam's avatar
Sam committed
26
    build:
Sam's avatar
Sam committed
27
      context: .
Sam's avatar
Sam committed
28
      args:
29
30
        - EXTERNAL_REG=${EXTERNAL_REG}
        - PYTHON_VERSION=${PYTHON_VERSION}
Sam's avatar
Sam committed
31
32
        - CKAN_VERSION=${CKAN_VERSION}
        - MAINTAINER=${MAINTAINER}
Sam's avatar
Sam committed
33
34
    depends_on:
      - db
Sam's avatar
Sam committed
35
36
      - solr
      - redis
Sam's avatar
Sam committed
37
    ports:
Sam's avatar
Sam committed
38
39
40
41
42
      - "8989:5000"
    env_file:
      - .env
    secrets:
      - ckan_config
Sam's avatar
Sam committed
43
44
    volumes:
      - ckan_storage:/var/lib/ckan
Sam's avatar
Sam committed
45
46
    networks:
      - ckan-internal
Sam's avatar
Sam committed
47
48

  db:
Sam's avatar
Sam committed
49
    container_name: ckan_db
Sam's avatar
Sam committed
50
    image: "${INTERNAL_REG}/ckan-db:latest"
51
52
53
54
55
    build:
      context: ./postgresql
      args:
        - EXTERNAL_REG=${EXTERNAL_REG}
        - MAINTAINER=${MAINTAINER}
Sam's avatar
Sam committed
56
    environment:
Sam's avatar
Sam committed
57
      - PGDATA=/var/lib/postgresql/data/db
Sam's avatar
Sam committed
58
59
60
61
      - POSTGRES_PASSWORD_FILE=/run/secrets/db_init_pass
    secrets:
      - db_init_pass
      - db_env_secret
Sam's avatar
Sam committed
62
63
    volumes:
      - pg_data:/var/lib/postgresql/data
Sam's avatar
Sam committed
64
65
    networks:
      - ckan-internal
Sam's avatar
Sam committed
66
    healthcheck:
Sam's avatar
Sam committed
67
      test: ["CMD", "pg_isready", "-U", "$CKAN_DB_USER"]
Sam's avatar
Sam committed
68
69

  solr:
Sam's avatar
Sam committed
70
    container_name: ckan_solr
Sam's avatar
Sam committed
71
    image: "${INTERNAL_REG}/ckan-solr:latest"
72
73
74
75
76
    build:
      context: ./solr
      args:
        - EXTERNAL_REG=${EXTERNAL_REG}
        - MAINTAINER=${MAINTAINER}
Sam's avatar
Sam committed
77
    volumes:
Sam's avatar
Sam committed
78
79
80
      - solr_data:/opt/solr/server/solr
    networks:
      - ckan-internal
Sam's avatar
Sam committed
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

  init-solr:
    container_name: ckan_init_solr
    image: "${INTERNAL_REG}/ckan-init-solr:latest"
    build:
      context: ./init_solr
      args:
        - EXTERNAL_REG=${EXTERNAL_REG}
        - MAINTAINER=${MAINTAINER}
    secrets:
      - solr_creds
    networks:
      - ckan-internal
    depends_on:
      - solr
Sam's avatar
Sam committed
96
97

  redis:
Sam's avatar
Sam committed
98
99
100
101
    container_name: ckan_redis
    image: redis:6.2
    networks:
      - ckan-internal