This repository has been archived by the owner on Jan 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
157 lines (149 loc) · 4.56 KB
/
docker-compose.prod.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
version: "2"
services:
workspace:
build:
context: ./www-workspace
args:
- TZ=${WORKSPACE_TIMEZONE}
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
command: [sh, -c, "cd /var/www/spa && npm i -y && npm run dist-prod && cd /var/www/auto-scaler && npm run forever && tail -F anything"]
# restart: always
environment:
# app stuff
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_NAME_TESTING=${DATABASE_NAME_TESTING}
- DB_HOST=${MYSQL_HOST}
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- APP_KEY=${APP_KEY}
- ELASTICSEARCH_HOST=${ELASTICSEARCH_HOST}
- ENV_ELASTICSEARCH_INDEX=${ENV_ELASTICSEARCH_INDEX}
- ENV_ELASTICSEARCH_INDEX_TESTING=${ENV_ELASTICSEARCH_INDEX_TESTING}
- SEARCH_CONFIDENCE_THRESHOLD=${SEARCH_CONFIDENCE_THRESHOLD}
# auto stuff
- API_GOOGLE_ELEVATION_KEY=${API_GOOGLE_ELEVATION_KEY}
- API_OPEN_CAGE_KEY=${API_OPEN_CAGE_KEY}
- AWS_KEY=${AWS_KEY}
- AWS_SECRET=${AWS_SECRET}
- AWS_REGION=${AWS_REGION_PROD}
- AWS_BUCKET_NAME=${AWS_BUCKET_NAME_PROD}
- AWS_BUCKET_NAME_TESTING=${AWS_BUCKET_NAME_TESTING}
- API_IMAGGA_KEY=${API_IMAGGA_KEY}
- API_IMAGGA_SECRET=${API_IMAGGA_SECRET}
- API_PLANT_NET_KEY=${API_PLANT_NET_KEY}
- API_OCR_SPACE_KEY=${API_OCR_SPACE_KEY}
- API_PLATE_RECOGNIZER=${API_PLATE_RECOGNIZER}
volumes:
- ./www-workspace:/var/www
depends_on: [mysql, elasticsearch]
php-fpm:
build:
context: ./docker-containers/php-fpm
environment:
- DATABASE_NAME=${DATABASE_NAME}
- DB_HOST=${MYSQL_HOST}
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
- DB_PORT=${MYSQL_PORT}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_USER=${MYSQL_USER}
- DATABASE_NAME_TESTING=${DATABASE_NAME_TESTING}
- APP_KEY=${APP_KEY}
- APP_DEBUG=${APP_DEBUG}
- USER_API_URL=${PROD_USER_API_URL}
- SPA_URL=${PROD_SPA_URL}
- ELASTICSEARCH_HOST=${ELASTICSEARCH_HOST}
- ENV_ELASTICSEARCH_INDEX=${ENV_ELASTICSEARCH_INDEX}
- ENV_ELASTICSEARCH_INDEX_TESTING=${ENV_ELASTICSEARCH_INDEX_TESTING}
- SEARCH_CONFIDENCE_THRESHOLD=${SEARCH_CONFIDENCE_THRESHOLD}
- DROPBOX_CLIENT_ID=${DROPBOX_CLIENT_ID}
- DROPBOX_CLIENT_SECRET=${DROPBOX_CLIENT_SECRET}
volumes:
- ./www-workspace:/var/www
expose:
- "9000"
nginx:
build:
context: ./docker-containers/nginx
args:
- PHP_UPSTREAM=php-fpm
volumes:
- ./www-workspace:/var/www
- ./docker-containers/nginx/sites:/etc/nginx/sites-available
ports:
- "80:80" # http
- "443:443" # ssl?
depends_on: [php-fpm, mysql, workspace]
mysql:
image: mysql:5.7
restart: always
ports:
- "3306:3306"
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
volumes:
- mysqldata:/var/lib/mysql
phpmyadmin:
build: ./docker-containers/phpmyadmin
environment:
- PMA_ARBITRARY=1
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_ROOT_PASSWORD}
ports:
- "8080:80"
depends_on:
- "mysql"
elasticsearch:
build: ./docker-containers/elasticsearch
restart: always
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
- elasticsearch-plugins:/usr/share/elasticsearch/plugins
environment:
- cluster.name=laradock-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- xpack.security.enabled=false
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1024m
ports:
- "9200:9200"
- "9300:9300"
frontend:
build: ./frontend
command: [sh, -c, "cd /frontend/server && yarn run prod-start & cd /frontend/client && yarn run prod-start"]
environment:
- FRONTEND_API_PORT=3200
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_NAME_TESTING=${DATABASE_NAME_TESTING}
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- JWT_COOKIE_SECRET=${JWT_COOKIE_SECRET}
ports:
- "3200:3200"
- "3201:3000"
- "9229:9229"
- "82:82"
- "8443:82"
volumes:
- ./frontend:/frontend
depends_on: [mysql, elasticsearch, phpmyadmin]
expose:
- "3200"
- "3201"
- "9229"
- "82"
- "8443"
volumes:
phpmyadmin:
driver: "local"
mysqldata:
driver: "local"
elasticsearch-data:
driver: "local"
elasticsearch-plugins:
driver: "local"