-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-EXAMPLE.yml
73 lines (63 loc) · 1.81 KB
/
docker-compose-EXAMPLE.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
version: "3.4"
services:
rica-db:
image: mariadb:10
restart: unless-stopped
container_name: rica-db
environment:
MYSQL_ROOT_PASSWORD: supersecret
MYSQL_USER: rica
MYSQL_PASSWORD: rica_password
MYSQL_DATABASE: rica
volumes:
- ./data/rica_data/db:/var/lib/mysql
rica-backend:
image: teamrocketballeballe/rica-backend
restart: unless-stopped
container_name: rica-backend
## if you want to build locally
# image: rica-backend
# build:
# context: .
# dockerfile: ./Dockerfile
environment: &backend_envvar
# to disable development API endpoints and generate a random
# cryptographic key used for signing session cookie
FLASK_ENV: production
# use python -c 'import secrets; print(secrets.token_hex())'
RICA_SECRET_KEY: "<some very secret key>"
# database host
RICA_MYSQL_HOST: rica-db
# database user & password
RICA_MYSQL_USER: rica
RICA_MYSQL_PASSWORD: rica_password
# database to use
RICA_MYSQL_DB: rica
ports:
- 5000:5000
depends_on:
- rica-db
- db-migration
db-migration:
image: teamrocketballeballe/rica-backend
container_name: rica-migration
## ensure db has the right schema if not, create it
command: flask create-db
## if you want to fill with testdata also
# command: bash -c "flask create-db && flask fill-testdata"
environment:
<<: *backend_envvar
FLASK_APP: backend/__init__
depends_on:
- rica-db
rica-frontend:
image: teamrocketballeballe/rica-frontend
restart: unless-stopped
container_name: rica-frontend
## if you want to build locally
# image: rica-frontend
# build:
# context: ./front-end
# dockerfile: Dockerfile
ports:
- "5001:80"