Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Commit 9969f0e

Browse files
Merge pull request #14 from thefringeninja/contater
Docker Improvements
2 parents ea05d76 + b4aab3a commit 9969f0e

18 files changed

Lines changed: 307 additions & 340 deletions

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/bin/
2+
**/obj/
3+
**/global.json
4+
**/Dockerfile*
5+
**/.dockerignore*
6+
**/*.user
7+
.idea/
8+
.vs/
9+
.vscode/

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,3 @@ paket-files/
250250
# JetBrains Rider
251251
.idea/
252252
*.sln.iml
253-
tools/**
254-
.dotnet

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
language: csharp
2-
mono: none
3-
dotnet: 2.1.400
1+
language: minimal
42
sudo: required
53
dist: trusty
64
script: ./build.sh

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM microsoft/dotnet:2.1.401-sdk-alpine3.7 AS build
2+
WORKDIR /src
3+
4+
COPY ./src/*.sln ./
5+
COPY ./src/*/*.csproj ./
6+
RUN for file in $(ls *.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done
7+
8+
COPY ./NuGet.Config ./
9+
10+
RUN dotnet restore
11+
12+
COPY ./src .
13+
14+
WORKDIR /build
15+
16+
COPY ./build/build.csproj .
17+
18+
RUN dotnet restore
19+
20+
COPY ./build .
21+
22+
WORKDIR /
23+
24+
RUN dotnet run --project build/build.csproj
25+
26+
WORKDIR /src/SqlStreamStore.HAL.DevServer
27+
28+
RUN dotnet publish --configuration=Release --output=/publish --no-build --no-restore
29+
30+
FROM microsoft/dotnet:2.1.3-aspnetcore-runtime-alpine3.7 AS runtime
31+
32+
WORKDIR /app
33+
COPY --from=build /publish ./
34+
35+
ENTRYPOINT ["dotnet", "SqlStreamStore.HAL.DevServer.dll"]

NuGet.Config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" ?>
2+
<configuration>
3+
<packageSources>
4+
<add key="sql-stream-store" value="https://www.myget.org/F/sqlstreamstore/api/v3/index.json" />
5+
</packageSources>
6+
</configuration>
7+

build.cake

Lines changed: 0 additions & 101 deletions
This file was deleted.

build.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker build .

build.ps1

Lines changed: 0 additions & 138 deletions
This file was deleted.

build.sh

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,3 @@
11
#!/usr/bin/env bash
2-
##########################################################################
3-
# This is the Cake bootstrapper script for Linux and OS X.
4-
# This file was downloaded from https://github.com/cake-build/resources
5-
# Feel free to change this file to fit your needs.
6-
##########################################################################
7-
8-
# Define directories.
9-
SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
10-
TOOLS_DIR=$SCRIPT_DIR/tools
11-
TOOLS_PROJ=$TOOLS_DIR/tools.csproj
12-
CAKE_VERSION=0.29.0
13-
CAKE_DLL=$TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION/cake.coreclr/$CAKE_VERSION/Cake.dll
14-
DOTNET_INSTALL_PATH=$SCRIPT_DIR/.dotnet
15-
16-
# Make sure the tools folder exist.
17-
if [ ! -d "$TOOLS_DIR" ]; then
18-
mkdir "$TOOLS_DIR"
19-
fi
202

21-
###########################################################################
22-
# Install .NET Core CLI
23-
###########################################################################
24-
curl -sSL https://dot.net/dotnet-install.sh | bash /dev/stdin --channel current --version 2.1.400 --install-dir $DOTNET_INSTALL_PATH
25-
26-
###########################################################################
27-
# INSTALL CAKE
28-
###########################################################################
29-
if [ ! -f "$CAKE_DLL" ]; then
30-
echo "<Project Sdk=\"Microsoft.NET.Sdk\"><PropertyGroup><TargetFramework>netcoreapp2.0</TargetFramework></PropertyGroup></Project>" > $TOOLS_PROJ
31-
dotnet add $TOOLS_PROJ package cake.coreclr -v $CAKE_VERSION --package-directory $TOOLS_DIR/Cake.CoreCLR.$CAKE_VERSION
32-
fi
33-
34-
# Make sure that Cake has been installed.
35-
if [ ! -f "$CAKE_DLL" ]; then
36-
echo "Could not find Cake.exe at '$CAKE_DLL'."
37-
exit 1
38-
fi
39-
40-
###########################################################################
41-
# RUN BUILD SCRIPT
42-
###########################################################################
43-
44-
# Start Cake
45-
CAKE_SETTINGS_SKIPVERIFICATION=true exec dotnet "$CAKE_DLL" "$@"
3+
docker build .

0 commit comments

Comments
 (0)