Skip to content

Commit 82ebdfe

Browse files
committed
First commit
0 parents  commit 82ebdfe

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM nginx:alpine
2+
WORKDIR /
3+
4+
COPY nginx.conf /etc/nginx/nginx.conf.template
5+
COPY entrypoint.sh /entrypoint.sh
6+
7+
ENTRYPOINT /entrypoint.sh

docker-hub/docker-build.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
HASH=$(git rev-parse --short HEAD)
4+
IMAGE_NAME=apisearchio/elasticsearch-nginx-proxy:commit-$HASH
5+
docker build -t "$IMAGE_NAME" .
6+
docker push $IMAGE_NAME

entrypoint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
envsubst < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
2+
3+
nginx -g "daemon off;"

nginx.conf

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
events {
2+
worker_connections 1024;
3+
}
4+
http {
5+
upstream elasticsearch {
6+
server ${ELASTICSEARCH_ENDPOINT}:${ELASTICSEARCH_PORT};
7+
keepalive 15;
8+
}
9+
10+
server {
11+
listen 8000;
12+
location / {
13+
resolver 8.8.8.8;
14+
resolver_timeout 5s;
15+
proxy_pass ${ELASTICSEARCH_PROTOCOL}://elasticsearch;
16+
proxy_http_version 1.1;
17+
proxy_set_header Connection "Keep-Alive";
18+
proxy_set_header Proxy-Connection "Keep-Alive";
19+
proxy_set_header Host ${ELASTICSEARCH_ENDPOINT}:${ELASTICSEARCH_PORT};
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)