-
Notifications
You must be signed in to change notification settings - Fork 12
/
Dockerfile
42 lines (32 loc) · 1.19 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
31
32
33
34
35
36
37
38
39
40
41
42
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
# install chrome for testing
RUN \
apt-get update && \
apt-get install -y wget gnupg
RUN \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google.list && \
apt-get update && \
apt-get install -y google-chrome-stable && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY src/JustSending/JustSending.csproj ./src/JustSending/JustSending.csproj
COPY test/JustSending.Test/JustSending.Test.csproj ./test/JustSending.Test/JustSending.Test.csproj
COPY JustSending.sln .
RUN dotnet restore -r linux-x64
COPY . /app
WORKDIR /app/test/JustSending.Test
RUN rm Drivers/chromedriver
RUN cp Drivers/Linux/chromedriver Drivers/
#RUN dotnet test
WORKDIR /app/src/JustSending
RUN cd /app/src/JustSending
RUN dotnet publish -c Release --no-restore --self-contained -o out/ /p:PublishSingleFile=true
RUN ls -lsah out/
# Build runtime image
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0
WORKDIR /app
COPY --from=build-env /app/src/JustSending/out .
VOLUME ["App_Data/"]
VOLUME ["wwwroot/uploads"]
ENTRYPOINT ["./JustSending"]