This commit is contained in:
Bastien Abadie 2018-05-24 10:04:38 +02:00
Родитель 4bbe4b9bc0
Коммит 1166f06aa8
5 изменённых файлов: 108 добавлений и 0 удалений

10
Dockerfile Normal file
Просмотреть файл

@ -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

36
docker/docker-compose.yml Normal file
Просмотреть файл

@ -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

33
docker/frontline.json Normal file
Просмотреть файл

@ -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"
}]
}
}

8
docker/nginx/Dockerfile Normal file
Просмотреть файл

@ -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;'

21
docker/nginx/proxy.conf Normal file
Просмотреть файл

@ -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;
}
}