-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (32 loc) · 804 Bytes
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Build stage
FROM microsoft/aspnetcore-build:2 AS build
# set working directory
WORKDIR /app
# Restore
COPY run/run.csproj ./run/
RUN dotnet restore run/run.csproj
COPY src/src.csproj ./src/
RUN dotnet restore src/src.csproj
COPY test/test.csproj ./test/
RUN dotnet restore test/test.csproj
# Copy src
COPY . .
# Test
ENV TEAMCITY_PROJECT_NAME=fake
#RUN dotnet test tests/tests.csproj
# Publish
RUN dotnet publish run/run.csproj -o /obj
# Runtime stage
FROM microsoft/aspnetcore:2
# set working directory
WORKDIR /app
# Copy compiled binaries
COPY --from=build /obj ./bin
# Copy configuration
COPY config/*.* ./config/
ENV MONGO_SERVICE_URI ""
ENV MONGO_SERVICE_HOST mongo
ENV MONGO_SERVICE_PORT 27017
ENV MONGO_DB app
EXPOSE 8080
CMD ["dotnet", "./bin/run.dll", "-c", "./config/config.yml"]