diff --git a/.gitignore b/.gitignore index 5a4d370b..34aac524 100644 --- a/.gitignore +++ b/.gitignore @@ -138,3 +138,5 @@ dmypy.json *.DS_Store .idea/ + +docker/*.whl diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..0e3bd09e --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ + +build: + python setup.py bdist_wheel --dist-dir docker +docker: build + sudo docker build -t ytdl-sub:0.1 docker/ + +.PHONY: build diff --git a/docker/Dockerfile b/docker/Dockerfile index 5186eae1..8c863ac4 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,25 @@ -FROM ghcr.io/linuxserver/baseimage-alpine:3.15 +FROM python:3.10.4-alpine3.15 + +# Needed for py deps +RUN apk add gcc g++ make libffi-dev openssl-dev USER ${PUID}:${PGID} -COPY . . +COPY ytdl_sub-0.0.1-py3-none-any.whl . + +RUN ls -lh +RUN pip install ytdl_sub-0.0.1-py3-none-any.whl + +############################################################################### +# S6 OVERLAY + +ARG S6_OVERLAY_VERSION=3.1.0.1 + +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-noarch.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-noarch.tar.xz +ADD https://github.com/just-containers/s6-overlay/releases/download/v${S6_OVERLAY_VERSION}/s6-overlay-x86_64.tar.xz /tmp +RUN tar -C / -Jxpf /tmp/s6-overlay-x86_64.tar.xz +ENTRYPOINT ["/init"] -RUN apk add --no-cache --upgrade \ - python3=3.10.4-r0 \ - pip3=22.0.4-r0 -RUN pip install -e . diff --git a/setup.cfg b/setup.cfg index 8883e44d..4798fc3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,3 +42,7 @@ lint = docs = sphinx==4.5.0 sphinx-rtd-theme==1.0.0 +build = + setuptools + wheel + diff --git a/setup.py b/setup.py new file mode 100644 index 00000000..6b40b52b --- /dev/null +++ b/setup.py @@ -0,0 +1,4 @@ +from setuptools import setup + +if __name__ == '__main__': + setup()