From 9185b59d16aeeebdc092c316cd166c9ccec45f4a Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Mon, 17 Aug 2020 12:07:28 +0100 Subject: [PATCH] Dockerfile builds from source Uses multi-stage build, like jfa-go. I'm hoping this'll shrink the image aswell. --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e2970ef --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM python:3.8.2-buster AS build + +COPY . /opt/build + +RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python + +RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - + +RUN cd /opt/build \ + && rm -rf dist \ + && apt install nodejs \ + && ~/.poetry/bin/poetry update \ + && pip install libsass \ + && python scss/get_node_deps.py \ + && python scss/compile.py -y \ + && python mail/generate.py -y \ + && ~/.poetry/bin/poetry build -f wheel + +FROM python:3.8.2-buster + +COPY --from=build /opt/build/dist /opt/dist + +RUN pip install /opt/dist/*.whl + +RUN sed -i 's#id="pwrJfPath" placeholder="Folder"#id="pwrJfPath" value="/jf" disabled#g' /usr/local/lib/python3.8/site-packages/jellyfin_accounts/data/templates/setup.html + +CMD [ "python3.8", "/usr/local/bin/jf-accounts", "-d", "/data" ]