-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
152 lines (145 loc) · 4.06 KB
/
docker-compose.yml
File metadata and controls
152 lines (145 loc) · 4.06 KB
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
volumes:
# FIXME: uncomment when searching feature is improved and re-enabled
# elasticsearch_data: {}
files_data: {}
configs_data: {}
services:
server:
build:
context: ./server
dockerfile: ../compose/server/Dockerfile
image: ocr-server
env_file: "server/.env"
environment:
FLASK_APP: app
FLASK_ENV: development
FLASK_DEBUG: 1
PYTHONUNBUFFERED: true
PYTHONDONTWRITEBYTECODE : true
command: /app/start
expose:
- "5001" # exposed only to other services
depends_on:
# FIXME: uncomment when searching feature is improved and re-enabled
# elasticsearch:
# condition: service_healthy
# restart: true
redis:
condition: service_healthy
restart: true
volumes:
- files_data:/app/_files
- configs_data:/app/_configs
restart: unless-stopped
networks:
- internal-network
worker:
build:
context: ./server
dockerfile: ../compose/worker/Dockerfile
image: ocr-worker
env_file: "server/.env"
hostname: "${HOSTNAME:-$COMPUTERNAME}" # set same hostname as host machine; try UNIX, else Windows
environment:
C_FORCE_ROOT: true
PYTHONUNBUFFERED: true
PYTHONDONTWRITEBYTECODE : true
command: celery -A celery_app.celery worker --beat --scheduler redbeat.RedBeatScheduler --autoscale=16,8 --max-tasks-per-child=1 --loglevel=debug --without-gossip --without-mingle -Ofair -E --hostname=worker1@%h -P prefork
healthcheck:
test: celery inspect ping -d worker1@$$HOSTNAME
interval: 10s
timeout: 10s
retries: 3
start_period: 10s
volumes:
- files_data:/app/_files
- configs_data:/app/_configs
depends_on:
redis:
condition: service_healthy
restart: true
restart: unless-stopped
networks:
- internal-network
- external-network
flower:
image: ocr-worker
env_file: "server/.env"
environment:
FLOWER_UNAUTHENTICATED_API: true # authentication managed through Flask
command: bash -c "celery -A celery_app.celery flower --port=5050 --url_prefix=$$APP_BASENAME\"/admin/flower\" --enable_events=False"
expose:
- "5050" # exposed only to other services
depends_on:
worker:
condition: service_healthy
restart: true
redis:
condition: service_healthy
restart: true
restart: unless-stopped
networks:
- internal-network
redis:
image: redis:8.2.1-alpine3.22
expose:
- "6379" # exposed only to other services
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 10s
retries: 10
start_period: 10s
volumes:
- files_data:/app/_files
restart: unless-stopped
networks:
- internal-network
nginx:
build:
context: .
dockerfile: ./compose/nginx/Dockerfile
ports:
- "80:80"
depends_on:
- server
volumes:
- files_data:/usr/share/nginx/html/files
environment:
NGINX_ENVSUBST_OUTPUT_DIR: /etc/nginx
MAX_FILE_CHUNK_SIZE: 2G
MAX_API_FILE_SIZE: 2G
MAX_DOC_SEGMENTATION_SIZE: 100M
MAX_EDITED_RESULTS_SIZE: 100M
NODE_ENV: development
restart: unless-stopped
networks:
- internal-network
- external-network
# FIXME: uncomment when searching feature is improved and re-enabled
# elasticsearch:
# build:
# context: ./compose/elasticsearch
# dockerfile: Dockerfile
# expose:
# - "9200" # exposed only to other services
# volumes:
# - elasticsearch_data:/usr/share/elasticsearch/data
# environment:
# xpack.security.enabled: false
# discovery.type: single-node
# healthcheck:
# test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:9200
# interval: 10s
# timeout: 30s
# retries: 15
# start_period: 10s
# restart: unless-stopped
# networks:
# - internal-network
networks:
internal-network:
driver: bridge
internal: true
external-network:
driver: bridge