-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
155 lines (147 loc) · 4.97 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
version: "3.7"
name: dagster-docker
services:
# This service runs the postgres DB used by dagster for run storage, schedule storage,
# and event log storage.
docker_postgresql:
image: postgres:13
restart: always
container_name: docker_postgresql
ports:
- '5433:5432' #host:container
environment:
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_DB: "postgres_db"
volumes:
- dagsterPostgres:/var/lib/postgresql/data
networks:
- docker_network
# This service runs the gRPC server that loads your user code, in both webserver
# and dagster-daemon. By setting DAGSTER_CURRENT_IMAGE to its own image, we tell the
# run launcher to use this same image when launching runs in a new container as well.
# Multiple containers like this can be deployed separately - each just needs to run on
# its own port, and have its own entry in the workspace.yaml file that's loaded by webserver.
docker_user_code:
build:
context: .
dockerfile: ./docker/user_code/Dockerfile
container_name: docker_user_code
image: docker_user_code_image
restart: always
environment:
DAGSTER_POSTGRES_USER: "postgres"
DAGSTER_POSTGRES_PASSWORD: "postgres"
DAGSTER_POSTGRES_DB: "postgres_db"
DAGSTER_CURRENT_IMAGE: "docker_user_code_image"
pwd: ${DATA_WAREHOUSE_POSTGRES_PASSWORD:-postgres}
uid: ${DATA_WAREHOUSE_POSTGRES_USER:-postgres}
server: data_warehouse_postgres
db: ${DATA_WAREHOUSE_POSTGRES_DBNAME:-energy_database}
port: 5432
schema: raw
MASTR_DOWNLOAD_DATE: ${MASTR_DOWNLOAD_DATE:-today}
DBT_PROFILE_FOLDER: prod
DAGSTER_HOME: /opt/dagster/dagster_home
IS_DEVELOP_MODE: False
networks:
- docker_network
depends_on:
- docker_postgresql
volumes:
- .:/opt/dagster/app
- /var/run/docker.sock:/var/run/docker.sock # to be able to run docker
- dagsterHomeData:/opt/dagster/dagster_home/data # have a shared volume that is also used by citygml container
# This service runs docker-webserver, which loads your user code from the user code container.
# Since our instance uses the QueuedRunCoordinator, any runs submitted from webserver will be put on
# a queue and later dequeued and launched by dagster-daemon.
docker_webserver:
build:
context: .
dockerfile: ./docker/dagster/Dockerfile
entrypoint:
- dagster-webserver
- -h
- "0.0.0.0"
- -p
- "3000"
- -w
- workspace.yaml
container_name: docker_webserver
restart: always
expose:
- "3000"
ports:
- ${DAGSTER_WEBSERVER_PORT:-3000}:3000
environment:
DAGSTER_POSTGRES_USER: "postgres"
DAGSTER_POSTGRES_PASSWORD: "postgres"
DAGSTER_POSTGRES_DB: "postgres_db"
volumes: # Make docker client accessible so we can terminate containers from webserver
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
networks:
- docker_network
depends_on:
- docker_postgresql
- docker_user_code
# This service runs the dagster-daemon process, which is responsible for taking runs
# off of the queue and launching them, as well as creating runs from schedules or sensors.
docker_daemon:
build:
context: .
dockerfile: ./docker/dagster/Dockerfile
entrypoint:
- dagster-daemon
- run
container_name: docker_daemon
restart: always
environment:
DAGSTER_POSTGRES_USER: "postgres"
DAGSTER_POSTGRES_PASSWORD: "postgres"
DAGSTER_POSTGRES_DB: "postgres_db"
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Make docker client accessible so we can launch containers using host docker
- /tmp/io_manager_storage:/tmp/io_manager_storage
networks:
- docker_network
depends_on:
- docker_postgresql
- docker_user_code
data_warehouse_postgres:
image: postgis/postgis:15-3.3
container_name: data_warehouse_postgres
restart: always
ports:
- ${DATA_WAREHOUSE_POSTGRES_PORT:-5510}:5432 #host:container
environment:
POSTGRES_DB: ${DATA_WAREHOUSE_POSTGRES_DBNAME:-energy_database}
POSTGRES_USER: ${DATA_WAREHOUSE_POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${DATA_WAREHOUSE_POSTGRES_PASSWORD:-postgres}
volumes:
- dataWarehousePostgresVolume:/var/lib/postgresql/data
- ./docker/init_energy_database.sql:/docker-entrypoint-initdb.d/create_schema.sql
networks:
- docker_network
geoserver:
image: docker.osgeo.org/geoserver:2.23.1
container_name: geoserver
restart: always
ports:
- ${GEOSERVER_PORT:-8002}:8080
volumes:
- "geoserverData:/opt/geoserver_data"
environment:
SKIP_DEMO_DATA: true
ROOT_WEBAPP_REDIRECT: true
networks:
- docker_network
networks:
docker_network:
driver: bridge
name: docker_network
volumes:
dagsterPostgres:
dataWarehousePostgresVolume:
dagsterHomeData:
geoserverData: