forked from SQLStreamStore/SQLStreamStore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (21 loc) · 777 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (21 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM damianh/dotnet-core-lts-sdks:2
WORKDIR /repo
# https://github.com/moby/moby/issues/15858
# Docker will flatten out the file structure on COPY
# We don't want to specify each csproj either - it creates pointless layers and it looks ugly
# https://code-maze.com/aspnetcore-app-dockerfiles/
COPY ./*.sln ./
COPY ./build/ ./build/
COPY ./src/*/*.csproj ./src/
RUN for file in $(ls src/*.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done
COPY ./tests/*/*.csproj ./tests/
RUN for file in $(ls tests/*.csproj); do mkdir -p ./${file%.*}/ && mv $file ./${file%.*}/; done
RUN dotnet restore
COPY ./assets ./assets/
COPY ./src ./src/
COPY ./tests ./tests/
WORKDIR /repo/build
COPY ./build/build.csproj .
RUN dotnet restore
COPY ./build .
WORKDIR /repo