From e51b1f794ad26a1a40c1ac8fd9b0041b8e14718a Mon Sep 17 00:00:00 2001 From: Bocki Date: Mon, 7 Feb 2022 12:44:57 +0100 Subject: [PATCH] Build internally with multistage --- Dockerfile | 37 ++++++++++++++++++++++++++++++------- docker-compose.yml.example | 24 ++++++++++++------------ 2 files changed, 42 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb3841c..1838a81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,22 @@ +FROM lsiobase/ubuntu:focal as builder + +RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \ + apt-get -y --no-install-recommends install >/dev/null \ + nodejs \ + git && \ + npm install --global yarn + +RUN git clone https://gitlab.com/RemixDev/deemix-gui.git --recursive + +WORKDIR /deemix-gui + +RUN yarn config set network-timeout 1000000 -g && \ + yarn install-all && \ + yarn build-server && \ + yarn build-webui && \ + yarn cache clean && \ + find . -name 'node_modules' -type d -prune -exec rm -rf '{}' \; + FROM lsiobase/ubuntu:focal ARG BUILDDATE @@ -10,19 +29,19 @@ LABEL \ app.deemix.image.description="Docker image for Deemix" \ maintainer="Bocki" +COPY --from=builder /deemix-gui /deemix-gui + RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash && \ apt-get -y --no-install-recommends install >/dev/null \ nodejs \ jq \ iputils-ping \ - curl \ - git && \ + curl && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* && \ npm install --global yarn -RUN git clone https://gitlab.com/RemixDev/deemix-gui.git --recursive && \ - rm -R /config && \ +RUN rm -R /config && \ mkdir /deemix-gui/server/music && \ mkdir -p /deem/.config/deemix && \ ln -sf /deemix-gui/server/music /downloads && \ @@ -30,9 +49,13 @@ RUN git clone https://gitlab.com/RemixDev/deemix-gui.git --recursive && \ WORKDIR /deemix-gui -RUN yarn install --prod --network-timeout 1000000 && \ - yarn --cwd server install --prod --network-timeout 1000000 && \ - yarn cache clean +RUN yarn config set network-timeout 1000000 -g && \ + yarn install --prod && \ + yarn --cwd server install --prod && \ + yarn cache clean + + +WORKDIR /deemix-gui COPY root/ / diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 59fa982..4261fc5 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -1,14 +1,14 @@ version: '3.3' services: - deemix: - image: registry.gitlab.com/bockiii/deemix-docker - container_name: Deemix - volumes: - - /your/storage/path/:/downloads - - /your/config/location:/config - environment: - - PUID=1000 - - PGID=1000 - - UMASK_SET=022 - ports: - - 6595:6595 \ No newline at end of file + deemix: + image: registry.gitlab.com/bockiii/deemix-docker + container_name: Deemix + volumes: + - /your/storage/path/:/downloads + - /your/config/location:/config + environment: + - PUID=1000 + - PGID=1000 + - UMASK_SET=022 + ports: + - 6595:6595 \ No newline at end of file