-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yml
139 lines (91 loc) · 2.42 KB
/
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
version: '3.8'
services:
nginx:
build:
context: .
ports:
- "80:80"
depends_on:
- api
volumes:
- type: volume
source: nginxLog
target : /var/log/nginx
- type: bind
source: ./nginx/deployment/default.conf
target: /etc/nginx/conf.d/default.conf
api:
build:
context: ./api
env_file:
- .env
# set up all the required environament variables required by the api service
environment:
# Api Required Keys Configs
SECRET_KEY: "${SECRET_KEY}"
ACTIVATION_KEY: "${ACTIVATION_KEY}"
ACCESS_KEY: "${ACCESS_KEY}"
REFRESH_KEY: "${REFRESH_KEY}"
# Database configs
MARIADB_USER: "${DATABASE_USER}"
MARIADB_PASSWORD: "${DATABASE_PASSWORD}"
MARIADB_DATABASE: "${DATABASE_NAME}"
# Mail server Configs
MAIL_SENDER: "${MAIL_SENDER}"
MAIL_SERVER: "${MAIL_SERVER}"
MAIL_USERNAME: "${MAIL_USERNAME}"
MAIL_PASSWORD: "${MAIL_PASSWORD}"
# Redis server Configs
REDIS_HOST: "${REDIS_HOST}"
REDIS_PORT: 6379
REDIS_PASSWORD: "${REDIS_PASSWORD}"
FLASK_ENV: "production"
user: "chama"
depends_on:
# - database
database:
condition: service_healthy
volumes:
- type : bind
source: ./api
target: /api
# use gunicon to serve the appication
# command: gunicorn --bind 0.0.0.0:5000 manage:app
command: bash deploy.sh
database:
build:
context: ./api/database
environment:
# Setting up environament variables
MARIADB_ROOT_PASSWORD: "${DATABASE_ROOT_PASSWORD}"
MYSQL_USER: "${DATABASE_USER}"
MYSQL_PASSWORD: "${DATABASE_PASSWORD}"
MYSQL_DATABASE: "${DATABASE_NAME}"
healthcheck:
test: ["CMD","/usr/local/bin/healthcheck.sh", "--su=mysql", "--connect", "--innodb_initialized"]
restart : always
expose:
- 3160
volumes:
- type : volume
source : mysqlData
target: /var/lib/mysql
redis:
image: 'bitnami/redis:latest'
restart: always
environment:
- REDIS_PASSWORD="${REDIS_PASSWORD}"
- REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL,CONFIG
expose:
- 6379
volumes:
- type : volume
source: redisData
target : /data
volumes:
mysqlData:
driver: local
redisData:
driver: local
nginxLog:
driver: local