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": "pyveth - veth network driver in Python", |
| | | "documentation": "https://github.com/jacekkow/docker-plugin-pyveth", |
| | | "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>=0.3 |
| | | Flask |
| | | pyroute2 |
| | | waitress |
| | |
| | | #!/usr/bin/env python3 |
| | | |
| | | import logging |
| | | import os |
| | | |
| | | import docker_plugin_api.Plugin |
| | | import flask |
| | | import waitress |
| | | |
| | | app = flask.Flask('pyveth') |
| | | app.logger.setLevel(logging.DEBUG) |
| | |
| | | app.register_blueprint(lib.NetworkDriver.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/pyveth.sock', threads=1) |