Skip to content

Commit ad90c94

Browse files
committed
feat(docker): 1.Dockerfile 2.docker-xxx.ps1
1 parent 2ec2e27 commit ad90c94

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed
File renamed without changes.

docker-build-simcaptchaclient.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker build -t yiyungent/simcaptchaclient -f examples/AspNetCoreClient/Dockerfile .

docker-run-simcaptcha.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docker stop simcaptcha-container
2+
docker rm simcaptcha-container
3+
docker run -d -p 5004:80 -p 5003:443 -e ASPNETCORE_URLS="http://*:80" --name simcaptcha-container yiyungent/simcaptcha

docker-run-simcaptchaclient.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
docker stop simcaptchaclient-container
2+
docker rm simcaptchaclient-container
3+
docker run -d -p 5002:80 -p 5001:443 --name simcaptchaclient-container yiyungent/simcaptchaclient

examples/AspNetCoreClient/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ EXPOSE 443
77

88
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
99
WORKDIR /src
10-
COPY ["examples/ASPNETCoreClient/AspNetCoreClient.csproj", "examples/ASPNETCoreClient/"]
10+
COPY ["examples/AspNetCoreClient/AspNetCoreClient.csproj", "examples/AspNetCoreClient/"]
1111
COPY ["src/SimCaptcha.AspNetCore/SimCaptcha.AspNetCore.csproj", "src/SimCaptcha.AspNetCore/"]
1212
COPY ["src/SimCaptcha/SimCaptcha.csproj", "src/SimCaptcha/"]
13-
RUN dotnet restore "examples/ASPNETCoreClient/AspNetCoreClient.csproj"
13+
RUN dotnet restore "examples/AspNetCoreClient/AspNetCoreClient.csproj"
1414
COPY . .
15-
WORKDIR "/src/examples/ASPNETCoreClient"
15+
WORKDIR "/src/examples/AspNetCoreClient"
1616
RUN dotnet build "AspNetCoreClient.csproj" -c Release -o /app/build
1717

1818
FROM build AS publish

examples/EasyAspNetCoreService/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
22

3-
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
3+
#FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
4+
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
45
WORKDIR /app
56
EXPOSE 80
67
EXPOSE 443
78

8-
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
9+
#FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
10+
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
911
WORKDIR /src
1012
COPY ["examples/EasyAspNetCoreService/EasyAspNetCoreService.csproj", "examples/EasyAspNetCoreService/"]
1113
COPY ["src/SimCaptcha.AspNetCore/SimCaptcha.AspNetCore.csproj", "src/SimCaptcha.AspNetCore/"]
1214
COPY ["src/SimCaptcha/SimCaptcha.csproj", "src/SimCaptcha/"]
1315
RUN dotnet restore "examples/EasyAspNetCoreService/EasyAspNetCoreService.csproj"
1416
COPY . .
1517
WORKDIR "/src/examples/EasyAspNetCoreService"
16-
RUN dotnet build "EasyAspNetCoreService.csproj" -c Release -o /app/build
18+
RUN dotnet build "EasyAspNetCoreService.csproj" -c Debug -o /app/build
1719

1820
FROM build AS publish
19-
RUN dotnet publish "EasyAspNetCoreService.csproj" -c Release -o /app/publish
21+
RUN dotnet publish "EasyAspNetCoreService.csproj" -c Debug -o /app/publish
2022

2123
FROM base AS final
2224
WORKDIR /app

0 commit comments

Comments
 (0)