Initial commit

master
Seednode 2 years ago
commit b322517996
  1. 18
      Dockerfile
  2. 21
      build.sh

@ -0,0 +1,18 @@
# set up dotnet build container
FROM ahendrix/dotnet-sdk-plus:latest AS build-env
# download app source
RUN git clone https://github.com/athendrix/chromecastserver /src/chromecastserver
# build app
WORKDIR /app
RUN cp /src/chromecastserver/*.csproj ./
RUN dotnet restore
RUN cp -r /src/chromecastserver/* ./
RUN dotnet publish -c Release -o out
# set up the final container
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine
WORKDIR /app
COPY --from=build-env /app/out .
CMD ["dotnet", "ChromecastServer.dll"]

@ -0,0 +1,21 @@
#!/usr/bin/env bash
# build, tag, and push docker images
# exit if a command fails
set -o errexit
# exit if required variables aren't set
set -o nounset
# if no registry is provided, tag image as "local" registry
registry="${REGISTRY:-local}"
# create docker image
docker build \
-t "$registry"/chromecastserver:latest \
-f Dockerfile .
# if a registry is specified, push to it
if [ "$registry" != "local" ]; then
docker push "$registry"/chromecastserver:latest
fi
Loading…
Cancel
Save