зеркало из https://github.com/mozilla/esFrontLine.git
Docker test environment
This commit is contained in:
Родитель
4bbe4b9bc0
Коммит
1166f06aa8
|
@ -0,0 +1,10 @@
|
|||
FROM python:2.7-alpine
|
||||
|
||||
ADD . /frontline
|
||||
COPY docker/frontline.json /etc/frontline.json
|
||||
|
||||
RUN pip install /frontline
|
||||
|
||||
ENV PYTHONPATH "/frontline/vendor"
|
||||
|
||||
CMD esFrontLine --settings-file /etc/frontline.json
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
version: "3.2"
|
||||
services:
|
||||
|
||||
nginx:
|
||||
container_name: frontline-proxy
|
||||
build: nginx
|
||||
|
||||
ports:
|
||||
- 8000:80
|
||||
|
||||
depends_on:
|
||||
- frontline
|
||||
|
||||
frontline:
|
||||
container_name: frontline-app
|
||||
build: ..
|
||||
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
|
||||
elasticsearch:
|
||||
container_name: frontline-es
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.0
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- discovery.type=single-node
|
||||
# X-Pack is installed in this image
|
||||
# but we don't need security in dev
|
||||
- xpack.security.enabled=false
|
||||
volumes:
|
||||
- esdata:/usr/share/elasticsearch/data
|
||||
|
||||
volumes:
|
||||
esdata:
|
||||
driver: local
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"elasticsearch":[{
|
||||
"host":"http://frontline-es",
|
||||
"port":9200
|
||||
}],
|
||||
"flask":{
|
||||
"host":"0.0.0.0",
|
||||
"port": 9292,
|
||||
"debug":false,
|
||||
"threaded":true,
|
||||
"processes":1
|
||||
},
|
||||
"url_prefix": "/elasticsearch",
|
||||
"users": [
|
||||
{
|
||||
"hawk": {
|
||||
"id": "babadie@mozilla.com",
|
||||
"key": "dummySecret",
|
||||
"algorithm": "sha256"
|
||||
},
|
||||
"resources": [
|
||||
"demo"
|
||||
]
|
||||
}
|
||||
],
|
||||
"whitelist":["demo"],
|
||||
"debug":{
|
||||
"log":[{
|
||||
"stream":"sys.stdout"
|
||||
}]
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
FROM nginx:alpine
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
COPY proxy.conf /etc/nginx/conf.d/proxy.conf
|
||||
|
||||
CMD nginx -g 'daemon off;'
|
|
@ -0,0 +1,21 @@
|
|||
upstream frontline {
|
||||
server frontline-app:9292;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
location / {
|
||||
add_header 'Content-Type' 'text/plain';
|
||||
return 200 'Hello World !';
|
||||
}
|
||||
|
||||
location /elasticsearch {
|
||||
|
||||
# frontline proxy conf
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_pass http://frontline;
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче