dockerfile touchups for kube

This commit is contained in:
dave 2020-10-05 20:12:21 -07:00
parent 64f738c5f0
commit 0c48fc013c
5 changed files with 62 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
Library/
.git/
testenv/
linuxenv/

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM ubuntu:focal
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y ffmpeg
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip libxml2-dev libxslt1-dev sudo sqlite3 && \
useradd --create-home --uid 1000 app
ADD requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
ADD . /tmp/code
RUN cd /tmp/code && \
python3 setup.py install && \
mv start.sh / && \
chmod +x /start.sh
ENTRYPOINT ["/start.sh", "--database-path", "/db/pysonic.sqlite", "--dirs", "/library"]

19
Makefile Normal file
View File

@ -0,0 +1,19 @@
BUILDARGS :=
IMAGE := dockermirror:5000/dpedu/pysonic
.PHONY: image
image:
docker build -t $(IMAGE) $(BUILDARGS) .
.PHONY: push
push: image
docker push $(IMAGE)
.PHONY: run-local
run-local:
pysonicd -d ./Library/ -u foo:bar -s ./db.sqlite --debug

14
README.md Normal file
View File

@ -0,0 +1,14 @@
pysonic
=======
subsonic api drop-in replacement
running docker
--------------
* `make image`
Notes:
* mount the sqlite database in /db/, it will be chowned automatically
* mount library in /library/

5
start.sh Normal file
View File

@ -0,0 +1,5 @@
#!/bin/bash
chown -R app:app /db/
exec sudo --preserve-env -Hu app pysonicd $@