Initial commit

master
Seednode 2021-01-10 14:16:20 -05:00
commit b322517996
2 changed files with 39 additions and 0 deletions

18
Dockerfile Normal file
View File

@ -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"]

21
build.sh Executable file
View File

@ -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