-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-compose.yml
238 lines (226 loc) · 6.73 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
version: "2"
services:
# https://docs.docker.com/docker-hub/builds/automated-testing/
sut:
build:
context: ./
dockerfile: Dockerfile.test
command: sh /docker_test.sh
# Only for travis-ci, do not name test container in dockerhub
container_name: sut
depends_on:
- erpnext_db
- erpnext_app
- erpnext_web
- erpnext_scheduler
- erpnext_worker_default
- erpnext_worker_long
- erpnext_worker_short
- erpnext_socketio
- erpnext_redis_cache
- erpnext_redis_queue
- erpnext_redis_socketio
environment:
# Container setup
- NODE_TYPE=test
# Docker setup
- DOCKER_APPS_TIMEOUT=900
- DOCKER_DEBUG=1
# Test setup
- TEST_VERSION=${VERSION}
- TRAVIS_BUILD_ID=${TRAVIS_BUILD_ID}
- TRAVIS_BUILD_NUMBER=${TRAVIS_BUILD_NUMBER}
- TRAVIS_BUILD_WEB_URL=${TRAVIS_BUILD_WEB_URL}
- TRAVIS_COMMIT=${TRAVIS_COMMIT}
- TRAVIS_COMMIT_MESSAGE=${TRAVIS_COMMIT_MESSAGE}
- TRAVIS_COMMIT_RANGE=${TRAVIS_COMMIT_RANGE}
- TRAVIS_JOB_ID=${TRAVIS_JOB_ID}
- TRAVIS_JOB_NAME=${TRAVIS_JOB_NAME}
- TRAVIS_JOB_NUMBER=${TRAVIS_JOB_NUMBER}
- TRAVIS_JOB_WEB_URL=${TRAVIS_JOB_WEB_URL}
- TRAVIS_BRANCH=${TRAVIS_BRANCH}
# Publish coverage
- CODACY_PROJECT_TOKEN=${CODACY_PROJECT_TOKEN}
- CODECOV_TOKEN=${CODECOV_TOKEN}
volumes_from:
- erpnext_app
volumes:
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_app:
build:
context: ./
dockerfile: Dockerfile
args:
- FRAPPE_APP_TO_TEST=${FRAPPE_APP_TO_TEST}
image: ${IMAGE_NAME}
container_name: erpnext_app
command: app
#restart: always
ports:
- 8000:8000
depends_on:
- erpnext_db
links:
- erpnext_db
environment:
# Docker setup
- DOCKER_DB_ALLOWED_HOSTS=
- DOCKER_APPS_TIMEOUT=900
# Frappe setup
- FRAPPE_APP_INIT=frappe erpnext ${FRAPPE_APP_TO_TEST}
- FRAPPE_DEFAULT_PROTOCOL=http://
- FRAPPE_DEFAULT_SITE=${ERPNEXT_SITE}
- FRAPPE_LOGGING=1
- DEVELOPER_MODE=1
- ALLOW_TESTS=1
#- Admin user setup
- ADMIN_PASSWORD=${ERPNEXT_ADMIN_PWD}
- ENCRYPTION_KEY=${ERPNEXT_ENCRYPTION_KEY}
# Database setup
- DB_TYPE=mariadb
- DB_HOST=erpnext_db
- DB_PORT=3306
- DB_NAME=${ERPNEXT_DB_NAME}
- DB_PASSWORD=${ERPNEXT_DB_PWD}
- DB_ROOT_PASSWORD=${ERPNEXT_DB_ROOT_PWD}
# Mail setup
- MAIL_MUTED=true
# Redis setup
- REDIS_CACHE_HOST=erpnext_redis_cache
- REDIS_QUEUE_HOST=erpnext_redis_queue
- REDIS_SOCKETIO_HOST=erpnext_redis_socketio
volumes:
#- .:/home/frappe/frappe-bench/apps/${FRAPPE_APP_TO_TEST}
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- ${ERPNEXT_HOME}/logs:/home/frappe/frappe-bench/logs
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_web:
image: nginx:alpine
container_name: erpnext_web
#restart: always
volumes:
- .travis/docker-nginx.conf:/etc/nginx/conf.d/default.conf:ro
# If you need SSL connection, you can provide your own certificates
# - ./certs:/etc/letsencrypt
# - ./certs-data:/data/letsencrypt
volumes_from:
- erpnext_app
depends_on:
- erpnext_app
ports:
- 8080:80
# If you need SSL connection
# - '8443:443'
links:
- erpnext_app
- erpnext_socketio
erpnext_db:
image: mariadb:10
container_name: erpnext_db
#restart: always
command: --character_set_client=utf8 --bind-address=0.0.0.0 --character-set-client-handshake=FALSE --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --sql-mode="ALLOW_INVALID_DATES"
environment:
- MYSQL_ROOT_PASSWORD=${ERPNEXT_DB_ROOT_PWD}
# Following parameters are not needed with Frappe 12 or higher since it will create DB itself
- MYSQL_DATABASE=${ERPNEXT_DB_NAME}
- MYSQL_USER=${ERPNEXT_DB_NAME}
- MYSQL_PASSWORD=${ERPNEXT_DB_PWD}
volumes:
- /srv/erpnext/db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_scheduler:
#build: ./
image: ${IMAGE_NAME}
container_name: erpnext_scheduler
command: scheduler
#restart: always
depends_on:
- erpnext_app
environment:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
volumes:
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_worker_default:
#build: ./
image: ${IMAGE_NAME}
container_name: erpnext_worker_default
command: worker-default
#restart: always
depends_on:
- erpnext_app
environment:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
volumes:
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_worker_long:
#build: ./
image: ${IMAGE_NAME}
container_name: erpnext_worker_long
command: worker-long
#restart: always
depends_on:
- erpnext_app
environment:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
volumes:
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_worker_short:
#build: ./
image: ${IMAGE_NAME}
container_name: erpnext_worker_short
command: worker-short
#restart: always
depends_on:
- erpnext_app
environment:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
volumes:
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_socketio:
#build: ./
image: ${IMAGE_NAME}
container_name: erpnext_socketio
command: node-socketio
#restart: always
ports:
- 3000:3000
depends_on:
- erpnext_app
environment:
# Docker setup
- DOCKER_APPS_TIMEOUT=900
volumes:
- ${ERPNEXT_HOME}/sites:/home/frappe/frappe-bench/sites
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
erpnext_redis_cache:
image: redis:alpine
container_name: erpnext_redis_cache
#restart: always
volumes:
- ./services/erpnext/conf/redis_cache.conf:/etc/conf.d/redis.conf:ro
command: ["redis-server","/etc/conf.d/redis.conf"]
erpnext_redis_queue:
image: redis:alpine
container_name: erpnext_redis_queue
#restart: always
erpnext_redis_socketio:
image: redis:alpine
container_name: erpnext_redis_socketio
#restart: always