-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (34 loc) · 1.14 KB
/
Dockerfile
File metadata and controls
48 lines (34 loc) · 1.14 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
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 as builder
# Set the current directory
WORKDIR /source
# Copy solutions and projects one by one to the current directory
COPY *.sln ./
COPY ./src/Api/Api.csproj ./src/Api/Api.csproj
COPY ./src/Application/Application.csproj ./src/Application/Application.csproj
COPY ./tests/Api.Tests/Api.Tests.csproj ./tests/Api.Tests/Api.Tests.csproj
COPY ./tests/Application.Tests/Application.Tests.csproj ./tests/Application.Tests/Application.Tests.csproj
# Run the restore of dependencies
RUN dotnet restore -r linux-musl-x64
#--source https://proget.fftech.info/Farfetch-Nuget-DEV/
COPY src/Api/. ./src/Api/
# Run publish
RUN dotnet publish ./src/Api/Api.csproj -c Release \
-r linux-musl-x64 \
-o /app \
--self-contained true \
/p:PublishSingleFile=true \
/p:PublishTr\immed=true
FROM alpine:latest
RUN apk --no-cache add \
ca-certificates \
icu-libs \
libintl
# Uncomment to enable globalization APIs
# ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT false
# ENV LC_ALL en_US.UTF-8
# ENV LANG en_US.UTF-8
WORKDIR /app
COPY --from=builder /app ./
RUN ls -lah
EXPOSE 80
ENTRYPOINT [ "./Api" ]