Replace uwsgi with waitress due to 400 Bad Request issues
1 files deleted
4 files modified
| | |
| | | FROM alpine |
| | | |
| | | RUN apk add uwsgi-python3 python3 py3-pip |
| | | RUN apk add python3 py3-pip |
| | | RUN mkdir -p /run/docker/plugins /usr/src/app \ |
| | | && chown -R nobody:nobody /run/docker/plugins /usr/src/app |
| | | USER nobody |
| | |
| | | |
| | | COPY --chown=nobody:nobody . . |
| | | |
| | | CMD [ "uwsgi", "--ini", "uwsgi.ini" ] |
| | | CMD [ "./run.py" ] |
| | |
| | | "description": "pyIPAM - IPAM driver in Python", |
| | | "documentation": "https://github.com/jacekkow/docker-plugin-pyipam", |
| | | "workdir": "/usr/src/app", |
| | | "entrypoint": ["uwsgi", "--ini", "uwsgi.ini"], |
| | | "entrypoint": ["./run.py"], |
| | | "env": [ |
| | | { |
| | | "name": "ENVIRONMENT", |
| | | "value": "production" |
| | | }, |
| | | { |
| | | "name": "HOME", |
| | | "value": "/usr/src/app" |
| | | } |
| | |
| | | docker-plugin-api |
| | | Flask |
| | | waitress |
| | |
| | | #!/usr/bin/env python3 |
| | | |
| | | import logging |
| | | import os |
| | | |
| | | import docker_plugin_api.Plugin |
| | | import flask |
| | | import waitress |
| | | |
| | | app = flask.Flask('pyIPAM') |
| | | app.logger.setLevel(logging.DEBUG) |
| | |
| | | app.register_blueprint(lib.IpamDriver.app) |
| | | |
| | | if __name__ == '__main__': |
| | | app.run(debug=True) |
| | | if os.environ.get('ENVIRONMENT', 'dev') == 'dev': |
| | | app.run(debug=True) |
| | | else: |
| | | waitress.serve(app, unix_socket='/run/docker/plugins/pyipam.sock', threads=1) |