Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@ EXPOSE 8080

# Set the entrypoint script and the default command run by the container
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["python", "-m", "openapi_server"]
# CMD ["uwsgi", "--ini", "uwsgi.ini", "--lazy", "--http-socket", ":8080"]

# Run server in development mode
# CMD ["python", "-m", "openapi_server"]

# Run server in production mode
CMD ["uwsgi", "--ini", "uwsgi.ini", "--lazy", "--http", ":8080"]
2 changes: 1 addition & 1 deletion server/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

if [ "$1" = 'python' ]; then
if [ "$1" = 'uwsgi' ] || [ "$1" = 'python' ]; then
cd ${APP_DIR}
exec gosu www-data "$@"
fi
Expand Down
4 changes: 1 addition & 3 deletions server/openapi_server/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

app = connexion.App(__name__, specification_dir='./openapi/')
app.app.json_encoder = encoder.JSONEncoder
app.add_api('openapi.yaml',
arguments={'title': 'NLP Sandbox Data Node API'},
pythonic_params=True)
app.add_api('openapi.yaml', pythonic_params=True)

# Configuring / to return the service information (required by NLP Sandbox)
app.add_url_rule('/', 'root', lambda: flask.redirect('/api/v1/service'))
Expand Down
3 changes: 2 additions & 1 deletion server/uwsgi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ master = true
chmod-sock = 660
vacuum = true
die-on-term = true
thunder-lock = true
thunder-lock = true
http-keepalive = 1