Browse Source

dockerfile touchups for kube

master
dave 1 month ago
parent
commit
0c48fc013c
5 changed files with 62 additions and 0 deletions
  1. +4
    -0
      .dockerignore
  2. +20
    -0
      Dockerfile
  3. +19
    -0
      Makefile
  4. +14
    -0
      README.md
  5. +5
    -0
      start.sh

+ 4
- 0
.dockerignore View File

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

+ 20
- 0
Dockerfile 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
- 0
Makefile 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
- 0
README.md 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
- 0
start.sh View File

@@ -0,0 +1,5 @@
#!/bin/bash

chown -R app:app /db/

exec sudo --preserve-env -Hu app pysonicd $@

Loading…
Cancel
Save