-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
156 lines (152 loc) · 5.47 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
# https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
x-service-provisioning-base: &provisioning-base
build:
args:
GID: ${GID:-0}
UID: ${UID:-0}
context: Dockerfile.d/provisioning
command:
- zsh
- -ic
- |
docker-util.keep-running.zsh --reset-status
/workspace/scripts/provisioning.init-terraform-with-backend.zsh --backend=$${_TERRAFORM_BACKEND_TYPE}\
&& docker-util.keep-running.zsh --record-success\
|| {
docker-util.keep-running.zsh --record-failure
exit 1
}
docker-util.keep-running.zsh --wait-signals
environment: &provisioning-base-environment
PROJECT_UNIQUE_ID: ~
# <AWS>
AWS_ACCESS_KEY_ID: ~
AWS_ACCOUNT_ID: ~
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-us-east-1}
AWS_SECRET_ACCESS_KEY: ~
# </AWS>
# <Azure>
AZURE_DEFAULT_LOCATION: ${AZURE_DEFAULT_LOCATION:-centralus}
ARM_CLIENT_ID: ~
ARM_CLIENT_SECRET: ~
ARM_SUBSCRIPTION_ID: ~
ARM_TENANT_ID: ~
# </Azure>
# <Google>
CLOUDSDK_CORE_PROJECT: ~
GCP_DEFAULT_REGION: ${GCP_DEFAULT_REGION:-us-central1}
GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS:-/workspace/config/credentials/google-cloud-keyfile.provisioning-owner.json}
# </Google>
# Suppress to be created the ".terraform" directory in the working directory.
TF_DATA_DIR: /tmp/provisioning/.terraform
TF_PLUGIN_CACHE_DIR: /tmp/provisioning/.terraform.d/plugin-cache
_TERRAFORM_BACKEND_TYPE: ${_TERRAFORM_BACKEND_TYPE:-none}
TF_VAR_allowed_ipaddr_list: ${TF_VAR_allowed_ipaddr_list}
TF_VAR_aws_access_key: ${AWS_ACCESS_KEY_ID}
TF_VAR_aws_default_region: ${AWS_DEFAULT_REGION:-us-east-1}
TF_VAR_aws_secret_key: ${AWS_SECRET_ACCESS_KEY}
TF_VAR_azure_default_location: ${AZURE_DEFAULT_LOCATION:-centralus}
TF_VAR_gcp_default_region: ${GCP_DEFAULT_REGION:-us-central1}
TF_VAR_gcp_project_id: ${CLOUDSDK_CORE_PROJECT}
TF_VAR_project_unique_id: ${PROJECT_UNIQUE_ID}
init: true
user: "${UID:-0}:${GID:-0}"
volumes:
- provisioning-tmp:/tmp/provisioning
- provisioning-home-developer:/home/developer
- provisioning-home-root:/root # for macOS & Windows
- /var/run/docker.sock:/var/run/docker.sock
- .:/workspace
working_dir: /workspace/provisioning
services:
# You are able to implement your service like below.
provisioning:
<<: *provisioning-base
# The following services are for Demonstration and CI/CD purposes; therefore, you can remove these.
provisioning-use-only-aws:
<<: *provisioning-base
environment:
PROJECT_UNIQUE_ID: ~
# <AWS>
AWS_ACCESS_KEY_ID: ~
AWS_ACCOUNT_ID: ~
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:-us-east-1}
AWS_SECRET_ACCESS_KEY: ~
# </AWS>
# Suppress to be created the ".terraform" directory in the working directory.
TF_DATA_DIR: /tmp/provisioning/.terraform
TF_PLUGIN_CACHE_DIR: /tmp/provisioning/.terraform.d/plugin-cache
_TERRAFORM_BACKEND_TYPE: s3
TF_VAR_allowed_ipaddr_list: ${TF_VAR_allowed_ipaddr_list}
TF_VAR_aws_access_key: ${AWS_ACCESS_KEY_ID}
TF_VAR_aws_default_region: ${AWS_DEFAULT_REGION:-us-east-1}
TF_VAR_aws_secret_key: ${AWS_SECRET_ACCESS_KEY}
TF_VAR_project_unique_id: ${PROJECT_UNIQUE_ID}
profiles:
- use-only-aws
provisioning-use-only-azure:
<<: *provisioning-base
environment:
PROJECT_UNIQUE_ID: ~
# <Azure>
AZURE_DEFAULT_LOCATION: ${AZURE_DEFAULT_LOCATION:-centralus}
ARM_CLIENT_ID: ~
ARM_CLIENT_SECRET: ~
ARM_SUBSCRIPTION_ID: ~
ARM_TENANT_ID: ~
# </Azure>
# Suppress to be created the ".terraform" directory in the working directory.
TF_DATA_DIR: /tmp/provisioning/.terraform
TF_PLUGIN_CACHE_DIR: /tmp/provisioning/.terraform.d/plugin-cache
_TERRAFORM_BACKEND_TYPE: azurerm
TF_VAR_allowed_ipaddr_list: ${TF_VAR_allowed_ipaddr_list}
TF_VAR_azure_default_location: ${AZURE_DEFAULT_LOCATION:-centralus}
TF_VAR_project_unique_id: ${PROJECT_UNIQUE_ID}
profiles:
- use-only-azure
provisioning-use-only-google-cloud:
<<: *provisioning-base
environment:
PROJECT_UNIQUE_ID: ~
# <Google>
CLOUDSDK_CORE_PROJECT: ~
GCP_DEFAULT_REGION: ${GCP_DEFAULT_REGION:-us-central1}
GOOGLE_APPLICATION_CREDENTIALS: ${GOOGLE_APPLICATION_CREDENTIALS:-/workspace/config/credentials/google-cloud-keyfile.provisioning-owner.json}
# </Google>
# Suppress to be created the ".terraform" directory in the working directory.
TF_DATA_DIR: /tmp/provisioning/.terraform
TF_PLUGIN_CACHE_DIR: /tmp/provisioning/.terraform.d/plugin-cache
_TERRAFORM_BACKEND_TYPE: gcs
TF_VAR_allowed_ipaddr_list: ${TF_VAR_allowed_ipaddr_list}
TF_VAR_gcp_default_region: ${GCP_DEFAULT_REGION:-us-central1}
TF_VAR_gcp_project_id: ${CLOUDSDK_CORE_PROJECT}
TF_VAR_project_unique_id: ${PROJECT_UNIQUE_ID}
profiles:
- use-only-google-cloud
# for Prettier Code Formatter
vscode:
build:
args:
GID: ${GID:-0}
UID: ${UID:-0}
context: Dockerfile.d/vscode
command:
- bash
- -c
- |
npm-check-updates --upgrade
npm install
npm audit fix
sort-package-json
user: ${UID:-0}:${GID:-0}
volumes:
- .:/workspace
working_dir: /workspace
version: "3.9"
volumes:
provisioning-tmp:
driver: local
provisioning-home-developer:
driver: local
provisioning-home-root:
driver: local