-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
30 lines (25 loc) · 1.1 KB
/
Dockerfile
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
FROM microsoft/aspnetcore-build:2.0 AS build-env
WORKDIR /app
# copy solution and projects, and then restore packages
COPY ./Kafka.Diff.sln .
COPY ./Common/Common.csproj ./Common/
COPY ./Publisher/Publisher.csproj ./Publisher/
COPY ./Publisher.Test.Unit/Publisher.Test.Unit.csproj ./Publisher.Test.Unit/
COPY ./Subscriber/Subscriber.csproj ./Subscriber/
COPY ./Subscriber.Test.Unit/Subscriber.Test.Unit.csproj ./Subscriber.Test.Unit/
COPY ./Test.Integration/Test.Integration.csproj ./Test.Integration/
RUN dotnet restore
# copy everything else and make binaries
COPY . ./
RUN dotnet publish -c Release -o out
# build runtime image
FROM microsoft/aspnetcore:2.0
WORKDIR /deploy
COPY --from=build-env /app/Publisher/out ./Publisher/
COPY --from=build-env /app/Publisher.Test.Unit/out ./Publisher.Test.Unit
COPY --from=build-env /app/Subscriber/out ./Subscriber
COPY --from=build-env /app/Subscriber.Test.Unit/out ./Subscriber.Test.Unit
COPY --from=build-env /app/Test.Integration/out ./Test.Integration
RUN echo "/usr/sbin/apache2" >> /etc/bash.bashrc
RUN echo "/path/to/mongodb" >> /etc/bash.bashrc
ENTRYPOINT ["/bin/bash"]