-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
145 lines (129 loc) · 3.88 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
# This is for development only! Do not run a production instance from this blueprint.
version: "3.4"
services:
proxy:
image: fragaria/karmen-proxy
build: ./src/proxy
env_file: [base.env, dev.env, local.env]
ports:
- 127.0.0.1:4000:9766
networks: [ backend, default ]
depends_on: [ frontend, backend_flask, fake_ws_proxy ]
frontend:
image: fragaria/karmen-frontend
build: ./src/karmen_frontend
env_file: [base.env, dev.env, local.env]
ports:
- 127.0.0.1:3000:9765
tty: true
volumes:
- ./src/karmen_frontend/src:/usr/src/app/src
- ./src/karmen_frontend/public:/usr/src/app/public
backend_flask: &backend_flask # <-- bookmark
image: fragaria/karmen-backend
build: ./src/karmen_backend
command: bash -c './scripts/migrate.sh && ./scripts/docker-start.sh'
env_file: [base.env, dev.env, local.env]
environment:
SERVICE: flask
ports:
- 127.0.0.1:5000:9764
volumes:
- ./src/karmen_backend/server:/usr/src/app/server
- ./tmp/karmen-files:/tmp/karmen-files
networks: [ printers, backend ]
depends_on: [ postgres ]
links: [ postgres, redis ]
postgres:
image: postgres:11
restart: unless-stopped
env_file: [base.env, dev.env, local.env]
volumes:
- ./tmp/db-data:/var/lib/postgresql/data
ports:
- 127.0.0.1:5433:5432
networks: [ backend ]
backend_celery_worker:
<<: *backend_flask # <-- reuse items from &backend_flask bookmark
# ... but skip migrations in backend_flask `command` property
command: scripts/docker-start.sh
environment:
SERVICE: celery-worker
ports: []
backend_celery_beat:
<<: *backend_flask # <-- reuse items from &backend_flask bookmark
# ... but skip migrations in backend_flask `command` property
command: scripts/docker-start.sh
environment:
SERVICE: celery-beat
ports: []
networks: [ backend ]
links: [ redis ]
redis:
image: redis:5
env_file: [base.env, dev.env, local.env]
networks: [ backend ]
dummymailserver:
image: fragaria/karmen-dummymailserver
build: ./src/dummymailserver
env_file: [base.env, dev.env, local.env]
networks: [ backend ]
ports:
- 127.0.0.1:8088:8088
fake_printer1:
image: fragaria/karmen-fakeprinter
build: ./src/fakeprinter
env_file: [base.env, dev.env, local.env]
environment:
STATE_JOB_NAME: "fake-file-being-printed.gcode"
networks:
printers:
ipv4_address: 172.16.236.11
fake_printer2:
image: fragaria/karmen-fakeprinter
build: ./src/fakeprinter
environment:
STATE_JOB_NAME: "fake-file-being-printed.gcode"
THROTTLE: 1 # delay any request 1 second
networks:
printers:
ipv4_address: 172.16.236.12
fake_printer3:
image: fragaria/karmen-fakeprinter
build: ./src/fakeprinter
environment:
STATE_JOB_STATE: "Operational"
networks:
printers:
ipv4_address: 172.16.236.13
fake_ws_proxy:
image: fragaria/karmen-fakewsproxy
build: ./src/fakewsproxy
networks: [ backend, printers ]
key_issuer:
image: fragaria/karmen-key-master
environment:
SECRET: 'your-super-secret-and-backed-up-private-keymaster-key'
MAX_SUB_LENGTH: 64
networks: [ backend ]
api_doc:
image: redocly/redoc
environment:
PAGE_TITLE: "Karmen OpenAPI"
PAGE_FAVICON: ${FRONTEND_BASE_URL:-http://localhost:4000}/favicon.ico
SPEC_URL: ${BACKEND_BASE_URL:-http://localhost:4000}/api/openapi-spec.yaml
PORT: 9898
networks: [ default, backend ]
depends_on: [ backend_flask ]
networks:
# backend network - must not be reachable by users
backend:
ipam:
config:
- subnet: 172.16.235.0/24
# printers - should be on a different network accessible only through
# websocket proxy server
printers:
ipam:
config:
- subnet: 172.16.236.0/24