Skip to content

Commit 36cc4e7

Browse files
committed
test dockerfile
1 parent 4782efe commit 36cc4e7

File tree

7 files changed

+19
-14
lines changed

7 files changed

+19
-14
lines changed

.dockerignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,6 @@ Dockerfile
282282

283283
# .env file contains default environment variables for docker
284284
.env
285-
.git/
285+
.git/
286+
bin/
287+
obj/

Conduit.sln

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{E0DF0C
2222
docker-compose.yml = docker-compose.yml
2323
Dockerfile = Dockerfile
2424
NuGet.config = NuGet.config
25+
.github\workflows\dotnetcore.yml = .github\workflows\dotnetcore.yml
26+
.dockerignore = .dockerignore
27+
.gitignore = .gitignore
2528
EndProjectSection
2629
EndProject
2730
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{79EC8D73-8DAD-430E-93CE-C1F29DBC33FA}"

Dockerfile

+4-10
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
22

3-
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
4-
WORKDIR /app
53

64
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
75
WORKDIR /src
8-
COPY ["build/build.csproj", "build/"]
9-
RUN dotnet restore "build/build.csproj"
106
COPY . .
11-
WORKDIR "/src/build"
12-
RUN dotnet build "build.csproj" -c Release -o /app/build
7+
RUN dotnet run --project build/build.csproj -- publish
138

14-
FROM build AS publish
15-
RUN dotnet publish "build.csproj" -c Release -o /app/publish /p:UseAppHost=false
9+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
1610

17-
FROM base AS final
1811
WORKDIR /app
19-
EXPOSE 5000
12+
COPY --link --from=build /src/publish .
13+
EXPOSE 8080
2014

2115
ENTRYPOINT ["dotnet", "Conduit.dll"]

build.ps1

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
$ErrorActionPreference = "Stop";
2+
3+
dotnet run --project build/build.csproj -- $args

build.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
dotnet run --project Build/Build.csproj -- "$@"

build/Program.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void RemoveDirectory(string d)
3939
() =>
4040
{
4141
Run("dotnet", "tool restore");
42-
Run("dotnet", "csharpier --check");
42+
Run("dotnet", "csharpier . --check");
4343
}
4444
);
4545

docker-compose.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
version: '3'
21
services:
32
conduit:
43
build: .
54
environment:
65
- ASPNETCORE_Conduit_DatabaseProvider=${ASPNETCORE_Conduit_DatabaseProvider}
76
- ASPNETCORE_Conduit_ConnectionString=${ASPNETCORE_Conduit_ConnectionString}
87
ports:
9-
- "5000:5000"
8+
- "8080:8080"

0 commit comments

Comments
 (0)