Skip to content

Commit 130689c

Browse files
Jose10gojyeros
Jose10go
authored andcommitted
add docker file to main project
1 parent 482bed1 commit 130689c

8 files changed

+97
-1
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.dockerignore
2+
.env
3+
.git
4+
.gitignore
5+
.vs
6+
.vscode
7+
docker-compose.yml
8+
docker-compose.*.yml
9+
*/bin
10+
*/obj

SuperCOOL.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperCOOL", "src\SuperCOOL\
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{EDCA8D29-0E96-4C87-9C87-3DC29395B9BB}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperCOOL.Tests", "tests\SuperCOOL.Tests\SuperCOOL.Tests.csproj", "{04A68000-2AD9-40FC-8846-BBB05C7B2E09}"
10+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SuperCOOL.Tests", "tests\SuperCOOL.Tests\SuperCOOL.Tests.csproj", "{04A68000-2AD9-40FC-8846-BBB05C7B2E09}"
11+
EndProject
12+
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{AFB8C995-0E5A-4703-85F8-E45C168E5E9C}"
1113
EndProject
1214
Global
1315
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -23,6 +25,10 @@ Global
2325
{04A68000-2AD9-40FC-8846-BBB05C7B2E09}.Debug|Any CPU.Build.0 = Debug|Any CPU
2426
{04A68000-2AD9-40FC-8846-BBB05C7B2E09}.Release|Any CPU.ActiveCfg = Release|Any CPU
2527
{04A68000-2AD9-40FC-8846-BBB05C7B2E09}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{AFB8C995-0E5A-4703-85F8-E45C168E5E9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{AFB8C995-0E5A-4703-85F8-E45C168E5E9C}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{AFB8C995-0E5A-4703-85F8-E45C168E5E9C}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{AFB8C995-0E5A-4703-85F8-E45C168E5E9C}.Release|Any CPU.Build.0 = Release|Any CPU
2632
EndGlobalSection
2733
GlobalSection(SolutionProperties) = preSolution
2834
HideSolutionNode = FALSE

docker-compose.dcproj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
3+
<PropertyGroup Label="Globals">
4+
<ProjectVersion>2.1</ProjectVersion>
5+
<DockerTargetOS>Linux</DockerTargetOS>
6+
<ProjectGuid>afb8c995-0e5a-4703-85f8-e45c168e5e9c</ProjectGuid>
7+
</PropertyGroup>
8+
<ItemGroup>
9+
<None Include="docker-compose.override.yml">
10+
<DependentUpon>docker-compose.yml</DependentUpon>
11+
</None>
12+
<None Include="docker-compose.yml" />
13+
<None Include=".dockerignore" />
14+
</ItemGroup>
15+
</Project>

docker-compose.override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version: '3.4'

docker-compose.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.4'
2+
3+
services:
4+
supercool:
5+
image: ${DOCKER_REGISTRY-}supercool
6+
build:
7+
context: .
8+
dockerfile: src/SuperCOOL/Dockerfile

src/SuperCOOL/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM microsoft/dotnet:2.1-sdk AS base # change to runtime
2+
WORKDIR /app
3+
4+
FROM microsoft/dotnet:2.1-sdk AS build
5+
WORKDIR /src
6+
COPY src/SuperCOOL/SuperCOOL.csproj src/SuperCOOL/
7+
RUN dotnet restore src/SuperCOOL/SuperCOOL.csproj
8+
COPY . .
9+
WORKDIR /src/src/SuperCOOL
10+
RUN dotnet build SuperCOOL.csproj -c Release -o /app
11+
12+
FROM build AS publish
13+
RUN dotnet publish SuperCOOL.csproj -c Release -o /app --no-restore
14+
15+
FROM base AS final
16+
WORKDIR /app
17+
COPY --from=publish /app .
18+
ENTRYPOINT ["bash"]

src/SuperCOOL/DockerfileMatcom

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM microsoft/dotnet:2.1-sdk AS base # change to runtime
2+
WORKDIR /app
3+
4+
FROM microsoft/dotnet:2.1-sdk AS build
5+
WORKDIR /src
6+
RUN echo "nameserver 10.6.100.66" > /etc/resolv.conf
7+
COPY src/SuperCOOL/SuperCOOL.csproj src/SuperCOOL/
8+
RUN dotnet restore src/SuperCOOL/SuperCOOL.csproj -s "http://packages.matcom.uh.cu:8081/repository/nuget.org-proxy/"
9+
COPY . .
10+
WORKDIR /src/src/SuperCOOL
11+
RUN dotnet build SuperCOOL.csproj -c Release -o /app
12+
13+
FROM build AS publish
14+
RUN dotnet publish SuperCOOL.csproj -c Release -o /app --no-restore
15+
16+
FROM base AS final
17+
WORKDIR /app
18+
COPY --from=publish /app .
19+
ENTRYPOINT ["bash"]

src/SuperCOOL/DockerfileOffline

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM microsoft/dotnet:2.1-sdk AS base # change to runtime
2+
WORKDIR /app
3+
4+
FROM microsoft/dotnet:2.1-sdk AS build
5+
WORKDIR /src
6+
COPY src/SuperCOOL/SuperCOOL.csproj src/SuperCOOL/
7+
COPY ["packages", "packages/"]
8+
RUN dotnet restore src/SuperCOOL/SuperCOOL.csproj -s packages/ -s /usr/share/dotnet/sdk/NuGetFallbackFolder/
9+
COPY . .
10+
WORKDIR /src/src/SuperCOOL
11+
RUN dotnet build SuperCOOL.csproj -c Release -o /app
12+
13+
FROM build AS publish
14+
RUN dotnet publish SuperCOOL.csproj -c Release -o /app --no-restore
15+
16+
FROM base AS final
17+
WORKDIR /app
18+
COPY --from=publish /app .
19+
ENTRYPOINT ["bash"]

0 commit comments

Comments
 (0)