-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.main.yml
94 lines (90 loc) · 3.29 KB
/
docker-compose.main.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
---
name: somenergia-jardiner
x-repo-common:
volumes: &repo-common-volumes
"./:/repo" # mount current directory at /repo
x-dbt-common:
# reusable bits, see https://docs.docker.com/compose/compose-file/10-fragments/
environment: &dbt-common-env # needed for ~/.dbt/profiles.yml
DBHOST: ${SOM_JARDINER_DB_HOST}
DBPORT: ${SOM_JARDINER_DB_PORT}
DBUSER: ${SOM_JARDINER_DB_USER}
DBPASSWORD: ${SOM_JARDINER_DB_PASSWORD}
DBNAME: ${SOM_JARDINER_DB_DBNAME}
version: "3.7"
services:
builder:
image: "harbor.somenergia.coop/dades/somenergia-jardiner-builder:${SOMENERGIA_DOCKER_TAG-latest}"
deploy:
replicas: 0 # never start service, since it is only for build purposes
build:
context: ./
dockerfile: docker/main/Dockerfile
target: builder
cache_from:
- "harbor.somenergia.coop/dades/somenergia-jardiner-builder:${SOMENERGIA_DOCKER_TAG-latest}"
main:
image: "harbor.somenergia.coop/dades/somenergia-jardiner-main:${SOMENERGIA_DOCKER_TAG-latest}"
deploy:
replicas: 0 # never start service, since it is only for build purposes
build:
context: ./
dockerfile: docker/main/Dockerfile
target: main
cache_from:
- "harbor.somenergia.coop/dades/somenergia-jardiner-main:${SOMENERGIA_DOCKER_TAG-latest}"
environment:
- SOMENERGIA_PROJECT_ENVIRONMENT=${SOMENERGIA_PROJECT_ENVIRONMENT?Not defined}
dev:
image: "harbor.somenergia.coop/dades/somenergia-jardiner-main-dev:${SOMENERGIA_DOCKER_TAG-latest}"
build:
context: ./
dockerfile: docker/main/Dockerfile
target: dev
cache_from:
- "harbor.somenergia.coop/dades/somenergia-jardiner-main-dev:${SOMENERGIA_DOCKER_TAG-latest}"
environment:
<<: *dbt-common-env
volumes:
- *repo-common-volumes
- python_venv_dev:/repo/.venv # mount virtualenv at /venv. See https://stackoverflow.com/a/74015989/5819113
command: /bin/sh -c "sleep infinity" # keep container running
networks:
- db_nw
dbt-deps:
image: "harbor.somenergia.coop/dades/somenergia-jardiner-dbt-deps:${SOMENERGIA_DOCKER_TAG-latest}"
deploy:
replicas: 0
build:
context: ./
dockerfile: docker/main/Dockerfile
target: dbt-deps
cache_from:
- "harbor.somenergia.coop/dades/somenergia-jardiner-dbt-deps:${SOMENERGIA_DOCKER_TAG-latest}"
environment:
<<: *dbt-common-env
volumes:
- *repo-common-volumes
- python_venv_dbt_deps:/repo/.venv # mount virtualenv at /venv. See https://stackoverflow.com/a/74015989/5819113
dbt-docs:
image: "harbor.somenergia.coop/dades/somenergia-jardiner-dbt-deps:${SOMENERGIA_DOCKER_TAG-latest}"
build:
context: ./
dockerfile: docker/main/Dockerfile
target: dbt-deps
cache_from:
- "harbor.somenergia.coop/dades/somenergia-jardiner-dbt-deps:${SOMENERGIA_DOCKER_TAG-latest}"
environment:
<<: *dbt-common-env
volumes:
- *repo-common-volumes
- python_venv_dbt_deps:/repo/.venv # mount virtualenv at /venv. See https://stackoverflow.com/a/74015989/5819113
command: bash -c "dbt docs generate --project-dir dbt_jardiner && dbt docs serve --project-dir dbt_jardiner --port 8050"
ports:
- 8050:8050
networks:
db_nw:
name: db_nw
volumes:
python_venv_dev:
python_venv_dbt_deps: