This repository has been archived by the owner on May 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
122 lines (121 loc) · 3.45 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
version: "3.7"
services:
vscode: # for prettier
build:
context: Dockerfile.d/vscode
args:
UID: ${UID:-0}
GID: ${GID:-0}
working_dir: /workspace
volumes:
- .:/workspace
user: "${UID:-0}:${GID:-0}"
command:
- bash
- -c
- |
jq -s '.[0] * .[1]' bff/.eslintrc.json frontend/.eslintrc.json > .eslintrc.json
# mv package.json /tmp/package.orig.json
# jq -s '.[0].devDependencies * .[1].devDependencies' bff/package.json frontend/package.json > /tmp/devDeps.json
# jq --argfile deps /tmp/devDeps.json '.devDependencies = $deps' /tmp/package.orig.json > package.json
npm install
mysql:
image: mysql:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
ports:
- "${BIND_IP_ADDR:-127.0.0.1}:3306:3306"
volumes:
- mysql-data:/var/lib/mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
redis:
image: redis:5
ports:
- "${BIND_IP_ADDR:-127.0.0.1}:6379:6379"
bff:
build:
context: Dockerfile.d/bff.development
args:
UID: ${UID:-0}
GID: ${GID:-0}
depends_on:
- mysql
- redis
working_dir: /workspace
volumes:
- ./bff:/workspace
- ./config.development/bff:/data/config/bff:ro
ports:
- "${BIND_IP_ADDR:-127.0.0.1}:4000:4000"
user: "${UID:-0}:${GID:-0}"
environment:
- BFF_CONFIG_CREADENTIALS_AMAZON_S3_ACCESS_KEY
- BFF_CONFIG_CREADENTIALS_AMAZON_S3_SECRET_ACCESS_KEY
- BFF_CONFIG_SOURCE_AMAZON_S3_BUCKET
- BFF_CONFIG_SOURCE_AMAZON_S3_PATHNAME
- BFF_CONFIG_CREADENTIALS_GOOGLE_CLOUD_STORAGE
- BFF_CONFIG_SOURCE_GOOGLE_CLOUD_STORAGE_BUCKET
- BFF_CONFIG_SOURCE_GOOGLE_CLOUD_STORAGE_PATHNAME
command:
- bash
- -c
- |
npm install
scripts/wait-mysql.sh mysql
npm run dev
frontend:
build:
context: Dockerfile.d/frontend.development
args:
UID: ${UID:-0}
GID: ${GID:-0}
depends_on:
- bff
working_dir: /workspace
volumes:
- ./frontend:/workspace
ports:
- "${BIND_IP_ADDR:-127.0.0.1}:3000:3000"
user: "${UID:-0}:${GID:-0}"
environment:
- BFF_ENDPOINT_URL=http://${PUBLIC_IP_ADDR}:4000/graphql
command:
- bash
- -c
- |
npm install
npm run dev
image-publisher:
build:
context: Dockerfile.d/image-publisher
args:
UID: ${UID:-0}
GID: ${GID:-0}
working_dir: /workspace
environment:
- GOOGLE_CLOUD_KEYFILE_JSON=/workspace/config/credentials/google-cloud-keyfile.json
- GOOGLE_APPLICATION_CREDENTIALS=/workspace/config/credentials/google-cloud-keyfile.json
- CLOUDSDK_CORE_PROJECT
volumes:
- image-publisher-dotconfig:/root/.config # for macOS
- image-publisher-dotconfig:/developer/.config
- image-publisher-dotdocker:/root/.docker # for macOS
- image-publisher-dotdocker:/developer/.docker
- /var/run/docker.sock:/var/run/docker.sock
- .:/workspace
command:
- bash
- -c
- |
gcloud auth activate-service-account --key-file=/workspace/config/credentials/google-cloud-keyfile.json
gcloud services enable containerregistry.googleapis.com
gcloud auth configure-docker --quiet
volumes:
mysql-data:
driver: local
image-publisher-dotconfig:
driver: local
image-publisher-dotdocker:
driver: local