Skip to content

Commit

Permalink
Merge pull request #36 from nlpsandbox/release-0.3.2
Browse files Browse the repository at this point in the history
Bump project version to 0.3.2
  • Loading branch information
tschaffter authored Feb 3, 2021
2 parents c8b25c1 + 2d8e9a3 commit ce24e12
Show file tree
Hide file tree
Showing 11 changed files with 1,570 additions and 318 deletions.
32 changes: 25 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,33 @@ version: "3.8"

services:
person-name-annotator:
image: nlpsandbox/person-name-annotator-example:0.3.1
image: nlpsandbox/person-name-annotator-example:0.3.2
build:
context: server
dockerfile: Dockerfile
container_name: person-name-annotator
healthcheck:
test: curl --fail http://localhost:8080/api/v1/healthCheck
interval: 10s
timeout: 5s
retries: 5
networks:
- nlp-sandbox-internal

nginx:
image: nginx:1.19.6-alpine
container_name: person-name-annotator-nginx
restart: always
environment:
- TOOL_HOST=person-name-annotator
- TOOL_PORT=8080
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/templates:/etc/nginx/templates:ro
networks:
- nlp-sandbox
- nlp-sandbox-internal
ports:
- "8080:8080"
- "80:80"
depends_on:
- person-name-annotator

networks:
nlp-sandbox:
nlp-sandbox-internal:
internal: true
8 changes: 8 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
user nginx;
worker_processes 1;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

include conf.d/events.conf;
include conf.d/http.conf;
3 changes: 3 additions & 0 deletions nginx/templates/events.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
events {
worker_connections 1024;
}
29 changes: 29 additions & 0 deletions nginx/templates/http.conf.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
http {
upstream tool {
server ${TOOL_HOST}:${TOOL_PORT};
keepalive 15;
}

server {
listen 80;
server_name tool;

error_log /var/log/nginx/tool.error.log;
access_log /var/log/nginx/tool.access.log;

location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";

proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";

proxy_pass http://tool;
}
}
}
Loading

0 comments on commit ce24e12

Please sign in to comment.