diff --git a/playlist_manager/Dockerfile b/playlist_manager/Dockerfile new file mode 100644 index 0000000..0331cd9 --- /dev/null +++ b/playlist_manager/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:3.7 +# dependencies needed for compiling c extensions +# also busybox-extras for telnet for easier use of backdoor +RUN apk --update add py2-pip gcc python-dev musl-dev file make busybox-extras + +# Install gevent so that we don't need to re-install it when common changes +RUN pip install gevent + +# Install common lib first as it changes less +COPY common /tmp/common +RUN pip install /tmp/common && rm -r /tmp/common + +# Install actual application +COPY playlist_manager /tmp/playlist_manager +RUN pip install /tmp/playlist_manager && rm -r /tmp/playlist_manager + +ENTRYPOINT ["python2", "-m", "playlist_manager"] diff --git a/playlist_manager/playlist_manager/__init__.py b/playlist_manager/playlist_manager/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/playlist_manager/playlist_manager/__main__.py b/playlist_manager/playlist_manager/__main__.py new file mode 100644 index 0000000..2550268 --- /dev/null +++ b/playlist_manager/playlist_manager/__main__.py @@ -0,0 +1,16 @@ + +import gevent.monkey +gevent.monkey.patch_all() + +import logging +import os + +import argh + +from playlist_manager.main import main + +LOG_FORMAT = "[%(asctime)s] %(levelname)8s %(name)s(%(module)s:%(lineno)d): %(message)s" + +level = os.environ.get('WUBLOADER_LOG_LEVEL', 'INFO').upper() +logging.basicConfig(level=level, format=LOG_FORMAT) +argh.dispatch_command(main) diff --git a/playlist_manager/playlist_manager/main.py b/playlist_manager/playlist_manager/main.py new file mode 100644 index 0000000..5562489 --- /dev/null +++ b/playlist_manager/playlist_manager/main.py @@ -0,0 +1,4 @@ + + +def main(): + pass diff --git a/playlist_manager/setup.py b/playlist_manager/setup.py new file mode 100644 index 0000000..febd9ed --- /dev/null +++ b/playlist_manager/setup.py @@ -0,0 +1,16 @@ +from setuptools import setup, find_packages + +setup( + name = "wubloader-playlist-manager", + version = "0.0.0", + packages = find_packages(), + install_requires = [ + "argh", + "gevent", + "prometheus-client", + "psycogreen", + "psycopg2", + "requests", + "wubloader-common", + ], +)