-
Notifications
You must be signed in to change notification settings - Fork 41
/
docker-compose-api.annif.org.yml
148 lines (137 loc) · 4.14 KB
/
docker-compose-api.annif.org.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
146
147
148
version: "3.6"
services:
annif_app:
image: quay.io/natlibfi/annif:0.52.0
command: ["gunicorn", "annif:create_app()", "--bind", "0.0.0.0:8000", "--timeout", "600"]
volumes:
- data:/annif-projects:ro
- /etc/localtime:/etc/localtime:ro
deploy:
replicas: 1
placement:
constraints:
- node.labels.environment == $NODE_LABELS_ENVIRONMENT
update_config:
order: start-first
healthcheck:
test: ["CMD", "curl", "--fail", "localhost:8000/v1/projects"]
interval: 15s
retries: 3
start_period: 600s
nginx:
image: nginx:1.19-alpine
volumes:
- webdata:/webdata:ro
- /etc/localtime:/etc/localtime:ro
- logs:/tmp
configs:
- nginx.conf
command: ["nginx", "-c", "/nginx.conf", "-g", "daemon off;"]
networks:
- default
- traefik-net
deploy:
replicas: 1
update_config:
failure_action: rollback
order: start-first
placement:
constraints:
- node.labels.environment == $NODE_LABELS_ENVIRONMENT
labels:
- traefik.enable=true
- traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80
- traefik.http.routers.${STACK_NAME}-http.rule=Host(`${SERVICE_DOMAIN}`)
- traefik.http.routers.${STACK_NAME}-http.entrypoints=http
#- traefik.http.routers.${STACK_NAME}-http.middlewares=redirect@file
- traefik.http.routers.${STACK_NAME}-https.rule=Host(`${SERVICE_DOMAIN}`)
- traefik.http.routers.${STACK_NAME}-https.entrypoints=https
- traefik.http.routers.${STACK_NAME}-https.tls=true
mauiserver:
image: quay.io/natlibfi/mauiserver:1.3.2-tomcat-8.5.59-jdk11-openjdk-slim
volumes:
- data:/annif-projects
- /etc/localtime:/etc/localtime:ro
environment:
- MAUI_SERVER_DATA_DIR=/annif-projects/mauidata
- JAVA_OPTS="-Duser.timezone=Europe/Helsinki"
deploy:
replicas: 1
placement:
constraints:
- node.labels.environment == $NODE_LABELS_ENVIRONMENT
modeldata_sync:
image: quay.io/natlibfi/annif-rsync
volumes:
- data:/annif-projects
- /etc/localtime:/etc/localtime:ro
secrets:
- source: annif-rsync-id-rsa
target: /home/rsync-user/.ssh/id_rsa
mode: 0400
uid: '998'
gid: '998'
- source: annif-kk-ssh-host-rsa-key
target: /home/rsync-user/.ssh/known_hosts
mode: 0600
uid: '998'
gid: '998'
command: rsync -avzLu --exclude '*-train.*' annif@$ANNIF_KK:/srv/annif-data/$SERVICE_DOMAIN/* /annif-projects
networks:
- traefik-net
deploy:
replicas: 0
restart_policy:
condition: none
placement:
constraints:
- node.labels.environment == $NODE_LABELS_ENVIRONMENT
webdata_sync:
image: quay.io/natlibfi/annif-svn
volumes:
- webdata:/tmp
- /etc/localtime:/etc/localtime:ro
command: svn checkout https://github.com/NatLibFi/Annif/branches/api-instances/$SERVICE_DOMAIN/ /tmp
deploy:
replicas: 0
restart_policy:
condition: on-failure
max_attempts: 3
placement:
constraints:
- node.labels.environment == $NODE_LABELS_ENVIRONMENT
matomo_importer:
image: quay.io/natlibfi/annif-logs-matomo-importer
volumes:
- logs:/tmp:ro
- /etc/localtime:/etc/localtime:ro
command: >
sh -c "
tail -f tmp/access.log | python2 import_logs.py --url=https://tilasto.lib.helsinki.fi --idsite=13 --token-auth $$(cat /run/secrets/matomo-token) --enable-http-errors --enable-http-redirects --enable-static --enable-bots --track-http-method --recorder-max-payload-size=10 -
"
secrets:
- matomo-token
deploy:
replicas: 1
placement:
constraints:
- node.labels.environment == $NODE_LABELS_ENVIRONMENT
volumes:
data:
webdata:
logs:
networks:
traefik-net:
external: true
configs:
nginx.conf:
external: true
name: ${STACK_NAME}-prod-nginx-proxy8
secrets:
annif-rsync-id-rsa:
external: true
annif-kk-ssh-host-rsa-key:
external: true
matomo-token:
external: true
name: annif-matomo-token