Skip to content

Commit

Permalink
openresty proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Dec 17, 2016
1 parent 8e8ad0b commit 9438fd6
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openresty/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# See https://github.com/openresty/docker-openresty/blob/master/alpine/Dockerfile
FROM openresty/openresty:1.11.2.2-alpine

COPY nginx.conf /usr/local/openresty/nginx/conf/nginx.conf
COPY profile.sh /etc/profile.d/netcomposer.sh
3 changes: 3 additions & 0 deletions openresty/build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NAME="netcomposer/elastic-openresty:1.11.2-0"
docker build -t $NAME . # && docker push $NAME

29 changes: 29 additions & 0 deletions openresty/build/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
worker_processes 1;

events {
worker_connections 1024;
}


http {
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;

upstream elastic {
server elastic:9200;
keepalive 15;
}

server {
listen 9200;
location / {
proxy_pass http://elastic;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
}
1 change: 1 addition & 0 deletions openresty/build/profile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export PATH=$PATH:/usr/local/openresty/nginx/sbin
15 changes: 15 additions & 0 deletions openresty/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
IMAGE=netcomposer/elastic-openresty:1.11.2-0

docker rm elastic_openresty > /dev/null 2>&1

docker run \
-ti \
--name elastic_openresty \
--network elastic \
-p 9201:9200 \
-v /etc/letsencrypt:/etc/letsencrypt:ro \
$IMAGE

# --restart unless-stopped \

12 changes: 12 additions & 0 deletions openresty/start_service.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
IMAGE=netcomposer/elastic-openresty:1.11.2-0

docker service create \
--name elastic_openresty \
--network elastic \
-p 9201:9200 \
--mount type=bind,src=/etc/letsencrypt,dst=/etc/letsencrypt:ro \
$IMAGE

# --restart unless-stopped \

0 comments on commit 9438fd6

Please sign in to comment.