diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b1efacc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +.idea/ + +dashmachine/user_data/ +dashmachine/static/images/icons +dashmachine/static/images/backgrounds diff --git a/Dockerfile b/Dockerfile index 012367b..e706048 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,19 @@ -FROM python:3.8.0-slim -RUN rm /bin/sh && ln -s /bin/bash /bin/sh -RUN apt-get update \ -&& apt-get install gcc git iputils-ping -y \ -&& apt-get clean +FROM python:3.8-slim -COPY ./ DashMachine -WORKDIR DashMachine -RUN pip install -r requirements.txt +RUN apt-get update -q \ + && apt-get install --no-install-recommends -qy \ + inetutils-ping \ + && rm -rf /var/lib/apt/lists/* + +COPY [ "requirements.txt", "/dashmachine/" ] + +WORKDIR /dashmachine + +RUN pip install --no-cache-dir --progress-bar off -r requirements.txt + +COPY [ ".", "/dashmachine/" ] + +ENV PRODUCTION=true EXPOSE 5000 -CMD ["python", "run.py"] \ No newline at end of file +VOLUME /dashmachine/dashmachine/user_data +CMD [ "gunicorn", "--bind", "0.0.0.0:5000", "wsgi:app" ] diff --git a/wsgi.py b/wsgi.py new file mode 100755 index 0000000..b07021d --- /dev/null +++ b/wsgi.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python3 + +from dashmachine import app +from dashmachine.main.utils import dashmachine_init + +dashmachine_init() + +if __name__ == "__main__": + app.run()