Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Docker (and compose) setup #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TheAssassin
Copy link

@TheAssassin TheAssassin commented Apr 12, 2020

Closes #8.

This PR provides a basic Docker setup. The Dockerfile can be used to build a Docker image right off the git repository.

Using docker-compose you can easily build and setup a container for snapcastr. Just copy the docker-compose.yml.example to docker-compose.yml, change the environment variable SNAPCAST_HOST to the right value (most likely an IP on your LAN), and hit docker-compose up -d.

@TheAssassin TheAssassin mentioned this pull request Apr 12, 2020
@xkonni
Copy link
Owner

xkonni commented Apr 14, 2020

sure, why not. but could you verify it works with the dev version? thank you very much!

@TheAssassin
Copy link
Author

Due to the lack of setup.py in favor of this new pyproject.toml (which, to be honest, I have never used before), installing with pip install -e ... does not work. Therefore I had to remove the -e. Less efficient (due to duplicate files in the Docker container), but it works. Your dev branch requires a compiler, so I had to install gcc and a few other dependencies, too.

diff --git a/Dockerfile b/Dockerfile
index d9ad732..6567bdb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,7 +4,9 @@ COPY . /app/
 
 WORKDIR /app/
 
-RUN pip install -e .
+RUN apk add --no-cache gcc python3-dev musl-dev libffi-dev openssl-dev && \
+    pip install . && \
+    apk del gcc python3-dev musl-dev libffi-dev openssl-dev
 
 EXPOSE 5011
 

You can rebase the PR to point to dev instead, and I'll fix things to work there, too, if you want.

@xkonni
Copy link
Owner

xkonni commented Apr 15, 2020

it's also in pypi now at https://pypi.org/project/snapcastr/ . guess that makes it even easier, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker image
2 participants