Skip to content
Merged
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
46 changes: 15 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN \
build-base \
cmake \
npm \
python3-dev \
yarn && \
python3 && \
npm install -g pnpm typescript && \
echo "*** install your_spotify ***" && \
if [ -z ${YOUR_SPOTIFY_VERSION+x} ]; then \
YOUR_SPOTIFY_VERSION=$(curl -sX GET "https://api.github.com/repos/Yooooomi/your_spotify/releases/latest" \
Expand All @@ -36,23 +36,23 @@ RUN \
echo "*** install your_spotify client ***" && \
cd /app/www && \
rm -rf /app/www/apps/server && \
yarn --frozen-lockfile && \
CI=true pnpm install --frozen-lockfile && \
cd /app/www/apps/client && \
yarn build && \
rm -rf /app/www/node_modules && \
yarn cache clean
pnpm typecheck && \
pnpm build

FROM buildbase AS buildserver

RUN \
echo "*** install your_spotify server ***" && \
cd /app/www && \
rm -rf /app/www/apps/client && \
yarn --frozen-lockfile && \
CI=true pnpm install --frozen-lockfile && \
cd /app/www/apps/server && \
yarn build && \
rm -rf /app/www/node_modules && \
yarn cache clean
rm eslint.config.mts && \
pnpm typecheck && \
pnpm build && \
rm -rf node_modules && \
NODE_ENV=production CI=true pnpm install --production --frozen-lockfile

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.22

Expand All @@ -62,34 +62,18 @@ ARG YOUR_SPOTIFY_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"

ENV HOME=/app
ENV HOME=/app \
NODE_ENV=production

COPY --from=buildclient /app/www/apps/client/build/ /app/www/apps/client/build/
COPY --from=buildbase /app/www/package.json /app/www/package.json
COPY --from=buildbase /app/www/yarn.lock /app/www/yarn.lock
COPY --from=buildserver /app/www/apps/server/lib/ /app/www/apps/server/lib/
COPY --from=buildserver /app/www/apps/server/package.json /app/www/apps/server/package.json
COPY --from=buildserver /app/www/apps/server/build/ /app/www/apps/server/build/

RUN \
echo "**** install build packages ****" && \
apk -U --update --no-cache add --virtual=build-dependencies \
build-base \
cmake \
python3-dev && \
echo "**** install runtime packages ****" && \
apk add -U --update --no-cache \
nodejs \
npm \
yarn && \
echo "**** install your_spotify ****" && \
cd /app/www/apps/server && \
yarn --production --frozen-lockfile && \
yarn cache clean && \
npm install -g serve && \
nodejs && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
$HOME/.cache \
Expand Down
48 changes: 16 additions & 32 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.22 as buildbase
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.22 AS buildbase

# set version label
ARG BUILD_DATE
Expand All @@ -15,8 +15,8 @@ RUN \
build-base \
cmake \
npm \
python3-dev \
yarn && \
python3 && \
npm install -g pnpm typescript && \
echo "*** install your_spotify ***" && \
if [ -z ${YOUR_SPOTIFY_VERSION+x} ]; then \
YOUR_SPOTIFY_VERSION=$(curl -sX GET "https://api.github.com/repos/Yooooomi/your_spotify/releases/latest" \
Expand All @@ -36,23 +36,23 @@ RUN \
echo "*** install your_spotify client ***" && \
cd /app/www && \
rm -rf /app/www/apps/server && \
yarn --frozen-lockfile && \
CI=true pnpm install --frozen-lockfile && \
cd /app/www/apps/client && \
yarn build && \
rm -rf /app/www/node_modules && \
yarn cache clean
pnpm typecheck && \
pnpm build

FROM buildbase AS buildserver

RUN \
echo "*** install your_spotify server ***" && \
cd /app/www && \
rm -rf /app/www/apps/client && \
yarn --frozen-lockfile && \
CI=true pnpm install --frozen-lockfile && \
cd /app/www/apps/server && \
yarn build && \
rm -rf /app/www/node_modules && \
yarn cache clean
rm eslint.config.mts && \
pnpm typecheck && \
pnpm build && \
rm -rf node_modules && \
NODE_ENV=production CI=true pnpm install --production --frozen-lockfile

FROM ghcr.io/linuxserver/baseimage-alpine-nginx:arm64v8-3.22

Expand All @@ -62,34 +62,18 @@ ARG YOUR_SPOTIFY_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"

ENV HOME=/app
ENV HOME=/app \
NODE_ENV=production

COPY --from=buildclient /app/www/apps/client/build/ /app/www/apps/client/build/
COPY --from=buildbase /app/www/package.json /app/www/package.json
COPY --from=buildbase /app/www/yarn.lock /app/www/yarn.lock
COPY --from=buildserver /app/www/apps/server/lib/ /app/www/apps/server/lib/
COPY --from=buildserver /app/www/apps/server/package.json /app/www/apps/server/package.json
COPY --from=buildserver /app/www/apps/server/build/ /app/www/apps/server/build/

RUN \
echo "**** install build packages ****" && \
apk -U --update --no-cache add --virtual=build-dependencies \
build-base \
cmake \
python3-dev && \
echo "**** install runtime packages ****" && \
apk add -U --update --no-cache \
nodejs \
npm \
yarn && \
echo "**** install your_spotify ****" && \
cd /app/www/apps/server && \
yarn --production --frozen-lockfile && \
yarn cache clean && \
npm install -g serve && \
nodejs && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
$HOME/.cache \
Expand Down
4 changes: 2 additions & 2 deletions root/etc/s6-overlay/s6-rc.d/svc-your_spotify/run
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
export API_ENDPOINT="${APP_URL}/api"
export CLIENT_ENDPOINT="${APP_URL}"

s6-setuidgid abc yarn --cwd /app/www/apps/server migrate
( cd /app/www/apps/server && s6-setuidgid abc node /app/www/apps/server/build/index.js --migrate )

exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 8080" \
cd /app/www/apps/server s6-setuidgid abc yarn start
cd /app/www/apps/server s6-setuidgid abc node /app/www/apps/server/build/index.js