forked from edgehog-device-manager/edgehog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
139 lines (131 loc) · 5.13 KB
/
docker-compose.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#
# This file is part of Edgehog.
#
# Copyright 2021-2024 SECO Mind Srl
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
services:
postgresql:
image: postgres:16.3
environment:
POSTGRES_USER: edgehog
POSTGRES_PASSWORD: edgehog
volumes:
- postgresql-data:/var/lib/postgresql/data
edgehog-backend:
image: edgehogdevicemanager/edgehog-backend:0.9.2
build:
context: backend
env_file: .env
environment:
DATABASE_USERNAME: edgehog
DATABASE_PASSWORD: edgehog
DATABASE_HOSTNAME: postgresql
DATABASE_NAME: postgres
SECRET_KEY_BASE: KKtB6BEPk1NVk6EmBfQCafphxLj7EW1M+BGPIFCT8X2LTywTFuGC6lM3yc8e3VKH
SEEDS_REALM_PRIVATE_KEY_FILE: /keys/realm_private.pem
SEEDS_TENANT_PRIVATE_KEY_FILE: /keys/tenant_private.pem
SEEDS_REALM_ORIGINAL_FILE: ${SEEDS_REALM_PRIVATE_KEY_FILE}
SEEDS_TENANT_ORIGINAL_FILE: ${SEEDS_TENANT_PRIVATE_KEY_FILE}
URL_HOST: edgehog-backend
URL_PORT: 4000
URL_SCHEME: http
EDGEHOG_FORWARDER_HOSTNAME: device-forwarder.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}
EDGEHOG_FORWARDER_PORT: 80
EDGEHOG_FORWARDER_SECURE_SESSIONS: "false"
restart: on-failure
volumes:
- type: bind
source: "${SEEDS_TENANT_PRIVATE_KEY_FILE}"
target: /keys/tenant_private.pem
- type: bind
source: "${SEEDS_REALM_PRIVATE_KEY_FILE}"
target: /keys/realm_private.pem
depends_on:
- postgresql
- minio
- minio-init
labels:
- "traefik.enable=true"
- "traefik.http.routers.edgehog-backend.rule=Host(`api.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
- "traefik.http.routers.edgehog-backend.entrypoints=web"
- "traefik.http.routers.edgehog-backend.service=edgehog-backend"
- "traefik.http.services.edgehog-backend.loadbalancer.server.port=4000"
edgehog-frontend:
image: edgehogdevicemanager/edgehog-frontend:0.9.2
build:
context: frontend
environment:
BACKEND_URL: http://api.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}/
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.routers.edgehog-frontend.rule=Host(`${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
- "traefik.http.routers.edgehog-frontend.entrypoints=web"
- "traefik.http.routers.edgehog-frontend.service=edgehog-frontend"
- "traefik.http.services.edgehog-frontend.loadbalancer.server.port=80"
edgehog-device-forwarder:
image: edgehogdevicemanager/edgehog-device-forwarder:0.1.0
environment:
RELEASE_NAME: edgehog-device-forwarder
SECRET_KEY_BASE: fXzwqLnU1V1bhfOwMRdm3tiGHRlfSpqmrw2aONac2QU4T9iwh3vjSIaweH1n0ZWg
PORT: 4001
PHX_HOST: device-forwarder.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}
restart: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.routers.edgehog-device-forwarder.rule=Host(`device-forwarder.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
- "traefik.http.routers.edgehog-device-forwarder.entrypoints=web"
- "traefik.http.routers.edgehog-device-forwarder.service=edgehog-device-forwarder"
- "traefik.http.services.edgehog-device-forwarder.loadbalancer.server.port=4001"
minio:
image: minio/minio:RELEASE.2023-01-18T04-36-38Z
volumes:
- "minio-data-v2:/data"
environment:
MINIO_ROOT_USER: "minioadmin"
MINIO_ROOT_PASSWORD: "minioadmin"
command: server --console-address ":9001" /data
labels:
- "traefik.enable=true"
- "traefik.http.routers.edgehog-minio-storage.rule=Host(`minio-storage.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
- "traefik.http.routers.edgehog-minio-storage.entrypoints=web"
- "traefik.http.routers.edgehog-minio-storage.service=edgehog-minio-storage"
- "traefik.http.services.edgehog-minio-storage.loadbalancer.server.port=9000"
- "traefik.http.routers.edgehog-minio-console.rule=Host(`minio.${DOCKER_COMPOSE_EDGEHOG_BASE_DOMAIN}`)"
- "traefik.http.routers.edgehog-minio-console.entrypoints=web"
- "traefik.http.routers.edgehog-minio-console.service=edgehog-minio-console"
- "traefik.http.services.edgehog-minio-console.loadbalancer.server.port=9001"
minio-init:
image: minio/mc:RELEASE.2023-01-11T03-14-16Z
depends_on:
- minio
entrypoint: |
/bin/sh -c "
while ! curl -s http://minio:9000 >/dev/null; do sleep 0.1; done;
/usr/bin/mc alias set minio http://minio:9000 minioadmin minioadmin;
/usr/bin/mc mb minio/edgehog;
/usr/bin/mc anonymous set download minio/edgehog;
exit 0;
"
volumes:
postgresql-data:
minio-data-v2:
driver: local
networks:
default:
name: astarte
external: true