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

Fix/docker #163

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "swingmusic-client"]
path = swingmusic-client
url = https://github.com/swing-opensource/swingmusic-client.git
34 changes: 30 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
##### CLIENT #####
FROM --platform=$BUILDPLATFORM node:16 as build-client

COPY ./swingmusic-client/ /build

WORKDIR /build
RUN yarn install && yarn build --outDir /out

###### SERVER ######
FROM python:3.10.11 as build-server

COPY . /build
COPY --from=build-client /out /build/client

WORKDIR /build
ENV LASTFM_API_KEY "missing"
ENV PLUGIN_LYRICS_AUTHORITY "missing"
ENV PLUGIN_LYRICS_ROOT_URL "missing"
ENV SWINGMUSIC_APP_VERSION "missing"

RUN apt update && apt install -y ffmpeg && apt autoclean -y && rm -rf /var/lib/apt/lists/*
RUN pip install poetry
RUN python -m poetry config virtualenvs.create false && \
python -m poetry install && \
python -m poetry run python manage.py --build

# Release
FROM ubuntu:latest

WORKDIR /
RUN apt update && apt install -y --no-install-recommends ffmpeg && apt autoclean -y && rm -rf /var/lib/apt/lists/*

COPY ./dist/swingmusic /swingmusic
COPY --from=build-server /build/dist/swingmusic /swingmusic

RUN chmod +x /swingmusic

EXPOSE 1970/tcp

VOLUME /music

VOLUME /config

ENTRYPOINT ["/swingmusic", "--host", "0.0.0.0", "--config", "/config"]
ENTRYPOINT ["/swingmusic", "--host", "0.0.0.0", "--config", "/config"]
9 changes: 5 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

# builds the latest version of the client and server

cd ../swingmusic-client
yarn build --outDir ../swingmusic/client
git submodule update --init
cd swingmusic-client
yarn build --outDir ../client

cd ../swingmusic
poetry run python manage.py --build
cd ..
poetry run python manage.py --build
1 change: 1 addition & 0 deletions swingmusic-client
Submodule swingmusic-client added at 12531e