diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e8bae64 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,21 @@ +pipeline { + agent any + stages { + stage('Build image') { + steps { + echo "Building docker image" + script { + dir('SessionCompanion/SessionCompanion'){ + def customImage = docker.build("session-companion:${env.BUILD_ID}") + //customImage.withRun('-p 5050:5050') + } + } + } + } + stage('Delete image') { + steps { + sh "docker rmi session-companion:${env.BUILD_ID}" + } + } + } +} diff --git a/SessionCompanion/SessionCompanion/Dockerfile b/SessionCompanion/SessionCompanion/Dockerfile new file mode 100644 index 0000000..9868635 --- /dev/null +++ b/SessionCompanion/SessionCompanion/Dockerfile @@ -0,0 +1,7 @@ +FROM mcr.microsoft.com/dotnet/sdk:5.0 + +ADD . /App +WORKDIR /App + +EXPOSE 5001 +CMD 'dotnet' 'build'