-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
179 lines (166 loc) · 5.26 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
version: "3.7"
volumes:
dagster_database:
driver: local
my_database:
driver: local
services:
docker_example_pgadmin:
image: dpage/pgadmin4
container_name: docker_example_pgadmin
environment:
- PGADMIN_DEFAULT_PASSWORD=pgadmin
ports:
- 7777:80
networks:
- docker_example_network
docker_example_my_postgresql:
image: postgres:14.5
container_name: docker_example_my_postgresql
ports:
- 5432:5432
expose:
- 5432:5432
environment:
POSTGRES_USER: ${MY_BD_POSTGRES_USER}
POSTGRES_PASSWORD: ${MY_BD_POSTGRES_PASSWORD}
POSTGRES_DB: ${MY_BD_POSTGRES_DB}
volumes:
- my_database:/var/lib/postgresql/data
networks:
- docker_example_network
docker_example_fastapi:
build:
context: ./fastapi
dockerfile: Dockerfile
container_name: docker_example_fastapi
image: docker_example_fastapi
expose:
- 4000:4000
ports:
- 4000:80
volumes:
- ./fastapi/app:/code/app
networks:
- docker_example_network
# This service runs the postgres DB used by dagster for run storage, schedule storage,
# and event log storage.
docker_example_postgresql:
image: postgres:11
container_name: docker_example_postgresql
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
volumes:
- dagster_database:/var/lib/postgresql/data
networks:
- docker_example_network
# This service runs the gRPC server that loads your user code, in both dagit
# 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 dagit.
docker_example_user_code:
build:
context: ./dagster
dockerfile: user_code.dockerfile
container_name: docker_example_user_code
image: docker_example_user_code_image
restart: always
environment:
DAGSTER_POSTGRES_USER: ${POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${POSTGRES_DB}
DAGSTER_CURRENT_IMAGE: "docker_example_user_code_image"
MY_AIRBYTE_HOST: ${MY_AIRBYTE_HOST}
MY_AIRBYTE_PORT: ${MY_AIRBYTE_PORT}
MY_DBT_HOST: ${MY_DBT_HOST}
MY_DBT_HOST_PORT: ${MY_DBT_HOST_PORT}
networks:
- docker_example_network
# This service runs dagit, which loads your user code from the user code container.
# Since our instance uses the QueuedRunCoordinator, any runs submitted from dagit will be put on
# a queue and later dequeued and launched by dagster-daemon.
docker_example_dagit:
build:
context: ./dagster
dockerfile: dagster_dagit.dockerfile
entrypoint:
- dagit
- -h
- "0.0.0.0"
- -p
- "3000"
- -w
- workspace.yaml
container_name: docker_example_dagit
image: docker_example_dagit
expose:
- "3000"
ports:
- "3000:3000"
environment:
DAGSTER_POSTGRES_USER: ${POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${POSTGRES_DB}
volumes: # Make docker client accessible so we can terminate containers from dagit
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
networks:
- docker_example_network
depends_on:
- docker_example_postgresql
- docker_example_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_example_daemon:
build:
context: ./dagster
dockerfile: dagster_dagit.dockerfile
entrypoint:
- dagster-daemon
- run
container_name: docker_example_daemon
image: docker_example_daemon
restart: on-failure
environment:
DAGSTER_POSTGRES_USER: ${POSTGRES_USER}
DAGSTER_POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
DAGSTER_POSTGRES_DB: ${POSTGRES_DB}
# MY_AIRBYTE_HOST: ${MY_AIRBYTE_HOST}
# MY_AIRBYTE_PORT: ${MY_AIRBYTE_PORT}
volumes: # Make docker client accessible so we can launch containers using host docker
- /var/run/docker.sock:/var/run/docker.sock
- /tmp/io_manager_storage:/tmp/io_manager_storage
networks:
- docker_example_network
depends_on:
- docker_example_postgresql
- docker_example_user_code
docker_example_dbt:
build:
context: ./dbt
dockerfile: Dockerfile
container_name: docker_example_dbt
image: docker_example_dbt
environment:
SF_ACCOUNT: ${SF_ACCOUNT}
SF_USER: ${SF_USER}
SF_PASSWORD: ${SF_PASSWORD}
SF_DATABASE: ${SF_DATABASE}
SF_ROLE: ${SF_ROLE}
SF_SCHEMA: ${SF_SCHEMA}
SF_WAREHOUSE: ${SF_WAREHOUSE}
SF_THREADS: ${SF_THREADS}
ports:
- 8580:8580
networks:
- docker_example_network
networks:
docker_example_network:
driver: bridge
name: docker_example_network
## docker run --name saultest -d docker_example_dbt tail -f /dev/null
## docker exec -it saultest bash