-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (40 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
50 lines (40 loc) · 1.75 KB
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
45
46
47
48
49
50
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS restore
WORKDIR /app
ARG BUILD_CONFIG="Release"
RUN mkdir -p /app/vsdbg && touch /app/vsdbg/touched
ENV DEBIAN_FRONTEND noninteractive
RUN if [ "${BUILD_CONFIG}" = "Debug" ]; then \
apt-get update && \
apt-get install apt-utils -y --no-install-recommends && \
apt-get install curl unzip -y && \
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /app/vsdbg; \
fi
ENV DEBIAN_FRONTEND teletype
ARG MYGET_API_KEY
COPY *.sln ./
COPY ./src/Ranger.Services.Subscriptions/Ranger.Services.Subscriptions.csproj ./src/Ranger.Services.Subscriptions/Ranger.Services.Subscriptions.csproj
COPY ./src/Ranger.Services.Subscriptions.Data/Ranger.Services.Subscriptions.Data.csproj ./src/Ranger.Services.Subscriptions.Data/Ranger.Services.Subscriptions.Data.csproj
COPY ./test/Ranger.Services.Subscriptions.Tests/Ranger.Services.Subscriptions.Tests.csproj ./test/Ranger.Services.Subscriptions.Tests/Ranger.Services.Subscriptions.Tests.csproj
COPY ./scripts ./scripts
RUN ./scripts/create-nuget-config.sh ${MYGET_API_KEY}
RUN dotnet restore
COPY ./src ./src
COPY ./test ./test
RUN dotnet publish -c ${BUILD_CONFIG} -o /app/published --no-restore
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=restore /app/published .
COPY --from=restore /app/vsdbg ./vsdbg
ARG BUILD_CONFIG="Release"
ARG ASPNETCORE_ENVIRONMENT="Production"
ENV ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT}
ARG DOCKER_IMAGE_TAG="NO_TAG"
ENV DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}
ENV DEBIAN_FRONTEND noninteractive
RUN if [ "${BUILD_CONFIG}" = "Debug" ]; then \
apt-get update && \
apt-get install procps -y; \
fi
ENV DEBIAN_FRONTEND teletype
EXPOSE 8089
ENTRYPOINT ["dotnet", "Ranger.Services.Subscriptions.dll"]