-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
84 lines (79 loc) · 2.56 KB
/
compose.yaml
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
# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Docker Compose reference guide at
# https://docs.docker.com/go/compose-spec-reference/
# Here the instructions define your application as a service called "server".
# This service is built from the Dockerfile in the current directory.
# You can add other services your application may depend on here, such as a
# database or a cache. For examples, see the Awesome Compose repository:
# https://github.com/docker/awesome-compose
services:
server:
build:
context: .
ports:
- 8000:8000
environment:
- SQL_PASS=/run/secrets/db-password
- MYSQL_ROOT_PASSWORD=/run/secrets/db-password
- TWILIO_ACCOUNT_SID=/run/secrets/twilio-sid
- TWILIO_AUTH_TOKEN=/run/secrets/twilio-token
- TWILIO_API_KEY=/run/secrets/twilio-api
- TWILIO_API_SECRET=/run/secrets/twilio-api-secret
- TWILIO_SERVICE_SID=/run/secrets/service-sid
- FLASK_ENV=docker
depends_on:
db:
condition: service_healthy
secrets:
- db-password
- twilio-sid
- twilio-token
- twilio-api
- twilio-api-secret
- service-sid
# The section below is an example of how to define a PostgreSQL
# database that your application can use. `depends_on` tells Docker Compose to
# start the database before your application. The `db-data` volume persists the
# database data between container restarts. The `db-password` secret is used
# to set the database password.
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
#image: mariadb:10-focal
# If you really want to use MySQL, uncomment the following line
image: mysql:8
restart: always
healthcheck:
test: ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 --password="$$(cat /run/secrets/db-password)" --silent']
interval: 3s
retries: 5
start_period: 30s
secrets:
- db-password
volumes:
- /usr/local/mysql/data/callassure:/db-data
- type: bind
source: ./initial-data
target: /docker-entrypoint-initdb.d/
environment:
- MYSQL_DATABASE=callassure
- MYSQL_USER=mysql
- MYSQL_ROOT_PASSWORD=/run/secrets/db-password
- MYSQL_PASSWORD=/run/secrets/db-password
expose:
- 3306
- 33060
volumes:
db-data:
secrets:
db-password:
file: db/password.txt
twilio-sid:
file: db/sid.txt
twilio-token:
file: db/auth.txt
twilio-api:
file: db/api.txt
twilio-api-secret:
file: db/secret.txt
service-sid:
file: db/service.txt