From ae2a3e8a72117666cff0c8c181ae02708ea620ca Mon Sep 17 00:00:00 2001 From: JP Dillingham Date: Sun, 7 Nov 2021 20:01:27 -0600 Subject: tweak dockerfile --- Dockerfile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 860a8222..2b8efbef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# build static web content FROM node:lts-alpine3.13 AS web ARG VERSION=0.0.1.65534-local @@ -8,6 +9,7 @@ COPY src/web src/web/. RUN sh ./bin/build --web-only --version $VERSION +# build, test, and publish application binaries # note: this needs to be pinned to an amd64 image in order to publish armv7 binaries # https://github.com/dotnet/dotnet-docker/issues/1537#issuecomment-615269150 FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim-amd64 AS publish @@ -27,8 +29,7 @@ RUN bash ./bin/build --dotnet-only --version $VERSION RUN bash ./bin/publish --no-prebuild --platform $TARGETPLATFORM --version $VERSION --output ../../dist/${TARGETPLATFORM} -# - +# application FROM mcr.microsoft.com/dotnet/runtime-deps:5.0-buster-slim AS slskd ARG TARGETPLATFORM ARG TAG=0.0.1 @@ -37,7 +38,7 @@ ARG REVISION=0 ARG BUILD_DATE LABEL org.opencontainers.image.title=slskd \ - org.opencontainers.image.description="a modern client-server application for the Soulseek file sharing network" \ + org.opencontainers.image.description="A modern client-server application for the Soulseek file sharing network" \ org.opencontainers.image.authors="slskd Team" \ org.opencontainers.image.vendor="slskd Team" \ org.opencontainers.image.licenses=AGPL-3.0 \ @@ -55,20 +56,18 @@ RUN apt-get update && apt-get install -y \ WORKDIR /slskd COPY --from=publish /slskd/dist/${TARGETPLATFORM} . -RUN bash -c 'mkdir -p /var/slskd/{incomplete,downloads,shared} \ - && chmod -R 777 /var/slskd' - ENV DOTNET_BUNDLE_EXTRACT_BASE_DIR=/var/tmp/.net \ SLSKD_HTTP_PORT=5000 \ - SLSKD_APP_DIR=/var/slskd \ - SLSKD_INCOMPLETE_DIR=/var/slskd/incomplete \ - SLSKD_DOWNLOADS_DIR=/var/slskd/downloads \ - SLSKD_SHARED_DIR=/var/slskd/shared \ + SLSKD_APP_DIR=/app \ SLSKD_DOCKER_TAG=$TAG \ SLSKD_DOCKER_VERSION=$VERSION \ SLSKD_DOCKER_REVISON=$REVISION \ SLSKD_DOCKER_BUILD_DATE=$BUILD_DATE +EXPOSE 5000 + +VOLUME /app + HEALTHCHECK --interval=60s --timeout=3s --start-period=5s --retries=3 CMD wget -q -O - http://localhost:5000/health ENTRYPOINT ["./slskd"] \ No newline at end of file -- cgit v1.2.3