-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dockerize solution for Windows and Linux Containers (#85)
* Dockerize solution for windows and linux docker container * Add new lines at the end on files. Fix merge mistake in a Startup.cs * Fix project file
- Loading branch information
1 parent
dd34e8c
commit 3936f1c
Showing
15 changed files
with
264 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3.7" | ||
|
||
services: | ||
|
||
coderr-server-web: | ||
image: "coderrio/coderrserverweb:latest" | ||
container_name: coderr-server-web | ||
hostname: coderr-server-web | ||
ports: | ||
- "2500:80" | ||
networks: | ||
- coderr_network | ||
|
||
volumes: | ||
esdata: | ||
driver: local | ||
|
||
networks: | ||
coderr_network: | ||
name: coderr_network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker-compose run -p 2500:80 -e "ConnectionStrings:Db"="Data Source=host.docker.internal,1433;Initial Catalog=Coderr99;User Id=sa; Password=Pass@word; Connect Timeout=15;" coderr-server-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: "3.7" | ||
|
||
services: | ||
|
||
coderr-server-web: | ||
image: "coderrio/win_coderrserverweb:latest" | ||
container_name: coderr-server-web | ||
hostname: coderr-server-web | ||
ports: | ||
- "2500:80" | ||
|
||
volumes: | ||
esdata: | ||
driver: local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
docker-compose run -p 2500:80 -e "ConnectionStrings:Db"="Data Source=172.**.**.1,1433;Initial Catalog=Coderr99;User Id=sa; Password=Pass@word; Connect Timeout=15;" coderr-server-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
COPY docker-compose_linux.yml docker-compose.yml | ||
COPY docker-compose_linux.override.yml docker-compose.override.yml | ||
CD Coderr.Server.Web | ||
COPY Dockerfile_Linux Dockerfile | ||
|
||
CD .. | ||
|
||
CALL BuildFrontend.bat | ||
|
||
docker-compose build | ||
|
||
ECHO built successfully | ||
|
||
docker push coderrio/coderrserverweb | ||
|
||
ECHO successfully pushed to dockerhub | ||
|
||
CD Coderr.Server.Web | ||
DEL Dockerfile | ||
CD .. | ||
DEL docker-compose.yml | ||
DEL docker-compose.override.yml | ||
|
||
ECHO Completed! | ||
PAUSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
COPY docker-compose_windows.yml docker-compose.yml | ||
COPY docker-compose_windows.override.yml docker-compose.override.yml | ||
CD Coderr.Server.Web | ||
COPY Dockerfile_Windows Dockerfile | ||
|
||
CD .. | ||
|
||
CALL BuildFrontend.bat | ||
|
||
docker-compose build | ||
|
||
ECHO built successfully | ||
|
||
docker push coderrio/win_coderrserverweb | ||
|
||
ECHO successfully pushed to dockerhub | ||
|
||
CD Coderr.Server.Web | ||
DEL Dockerfile | ||
CD .. | ||
DEL docker-compose.yml | ||
DEL docker-compose.override.yml | ||
|
||
ECHO Completed! | ||
PAUSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CD Coderr.Server.Web | ||
|
||
call npm ci | ||
call node node_modules/webpack/bin/webpack.js --config webpack.config.prod.js --mode=production | ||
|
||
CD .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build | ||
WORKDIR /src | ||
COPY ["Coderr.Server.Web/Coderr.Server.Web.csproj", "Coderr.Server.Web/"] | ||
COPY ["Coderr.Server.Abstractions/Coderr.Server.Abstractions.csproj", "Coderr.Server.Abstractions/"] | ||
COPY ["Coderr.Server.Api/Coderr.Server.Api.csproj", "Coderr.Server.Api/"] | ||
COPY ["Coderr.Server.Infrastructure/Coderr.Server.Infrastructure.csproj", "Coderr.Server.Infrastructure/"] | ||
COPY ["Coderr.Server.App/Coderr.Server.App.csproj", "Coderr.Server.App/"] | ||
COPY ["Coderr.Server.ReportAnalyzer.Abstractions/Coderr.Server.ReportAnalyzer.Abstractions.csproj", "Coderr.Server.ReportAnalyzer.Abstractions/"] | ||
COPY ["Coderr.Server.Domain/Coderr.Server.Domain.csproj", "Coderr.Server.Domain/"] | ||
COPY ["Coderr.Server.ReportAnalyzer/Coderr.Server.ReportAnalyzer.csproj", "Coderr.Server.ReportAnalyzer/"] | ||
COPY ["Coderr.Server.SqlServer/Coderr.Server.SqlServer.csproj", "Coderr.Server.SqlServer/"] | ||
RUN dotnet restore "Coderr.Server.Web/Coderr.Server.Web.csproj" | ||
COPY . . | ||
WORKDIR "/src/Coderr.Server.Web" | ||
RUN dotnet build "Coderr.Server.Web.csproj" -c Release -o /app/build | ||
|
||
WORKDIR /src | ||
COPY Coderr.Server.Web/wwwroot Coderr.Server.Web/wwwroot | ||
|
||
|
||
WORKDIR "/src/Coderr.Server.Web" | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "Coderr.Server.Web.csproj" -c Release -o /app/publish | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "Coderr.Server.Web.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
|
||
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed. | ||
#For more information, please see https://aka.ms/containercompat | ||
|
||
FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1809 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
|
||
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1809 AS build | ||
WORKDIR /src | ||
COPY ["Coderr.Server.Web/Coderr.Server.Web.csproj", "Coderr.Server.Web/"] | ||
COPY ["Coderr.Server.Abstractions/Coderr.Server.Abstractions.csproj", "Coderr.Server.Abstractions/"] | ||
COPY ["Coderr.Server.Api/Coderr.Server.Api.csproj", "Coderr.Server.Api/"] | ||
COPY ["Coderr.Server.Infrastructure/Coderr.Server.Infrastructure.csproj", "Coderr.Server.Infrastructure/"] | ||
COPY ["Coderr.Server.App/Coderr.Server.App.csproj", "Coderr.Server.App/"] | ||
COPY ["Coderr.Server.ReportAnalyzer.Abstractions/Coderr.Server.ReportAnalyzer.Abstractions.csproj", "Coderr.Server.ReportAnalyzer.Abstractions/"] | ||
COPY ["Coderr.Server.Domain/Coderr.Server.Domain.csproj", "Coderr.Server.Domain/"] | ||
COPY ["Coderr.Server.ReportAnalyzer/Coderr.Server.ReportAnalyzer.csproj", "Coderr.Server.ReportAnalyzer/"] | ||
COPY ["Coderr.Server.SqlServer/Coderr.Server.SqlServer.csproj", "Coderr.Server.SqlServer/"] | ||
|
||
RUN dotnet restore "Coderr.Server.Web/Coderr.Server.Web.csproj" | ||
|
||
COPY . . | ||
WORKDIR "/src/Coderr.Server.Web" | ||
RUN dotnet build "Coderr.Server.Web.csproj" -c Release -o /app/build | ||
|
||
WORKDIR /src | ||
|
||
COPY Coderr.Server.Web/wwwroot Coderr.Server.Web/wwwroot | ||
|
||
WORKDIR "/src/Coderr.Server.Web" | ||
|
||
FROM build AS publish | ||
RUN dotnet publish "Coderr.Server.Web.csproj" -c Release -o /app/publish | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "Coderr.Server.Web.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: '3.7' | ||
|
||
services: | ||
coderr.server.web: | ||
environment: | ||
- ASPNETCORE_ENVIRONMENT=Production | ||
- ASPNETCORE_URLS=https://+:443;http://+:80 | ||
- ASPNETCORE_HTTPS_PORT=50473 | ||
networks: | ||
- coderr_network | ||
ports: | ||
- "2500:80" | ||
volumes: | ||
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro | ||
- ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.7' | ||
|
||
services: | ||
coderr.server.web: | ||
image: coderrio/coderrserverweb | ||
build: | ||
context: . | ||
dockerfile: Coderr.Server.Web/Dockerfile | ||
networks: | ||
- coderr_network | ||
|
||
volumes: | ||
esdata: | ||
driver: local | ||
|
||
networks: | ||
coderr_network: | ||
name: coderr_network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: '3.7' | ||
|
||
services: | ||
coderr.server.web: | ||
environment: | ||
- ASPNETCORE_ENVIRONMENT=Production | ||
- ASPNETCORE_URLS=https://+:443;http://+:80 | ||
- ASPNETCORE_HTTPS_PORT=50473 | ||
networks: | ||
- coderr_network_win | ||
ports: | ||
- "2500:80" | ||
volumes: | ||
- ${APPDATA}/Microsoft/UserSecrets:C:\Users\ContainerUser\AppData\Roaming\Microsoft\UserSecrets:ro |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.7' | ||
|
||
services: | ||
coderr.server.web: | ||
image: coderrio/win_coderrserverweb | ||
build: | ||
context: . | ||
dockerfile: Coderr.Server.Web/Dockerfile | ||
networks: | ||
- coderr_network_win | ||
|
||
volumes: | ||
esdata: | ||
driver: local | ||
|
||
networks: | ||
coderr_network_win: | ||
name: coderr_network_win |