Browse Source

dockerfile touchups for kube

master
dave 1 year ago
parent
commit
0c48fc013c
  1. 4
      .dockerignore
  2. 20
      Dockerfile
  3. 19
      Makefile
  4. 14
      README.md
  5. 5
      start.sh

4
.dockerignore

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

20
Dockerfile

@ -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

@ -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

@ -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

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