-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDockerfile
33 lines (25 loc) · 1.37 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
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ENV NODE_VERSION 18.2.0
ENV NODE_DOWNLOAD_SHA 73d3f98e96e098587c2154dcaa82a6469a510e89a4881663dc4c86985acf245e
ENV NODE_DOWNLOAD_URL https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz
RUN wget "$NODE_DOWNLOAD_URL" -O nodejs.tar.gz \
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
&& rm nodejs.tar.gz \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \
&& apt update \
&& apt-get install -y nodejs
WORKDIR /src
RUN echo "dotnet Version:" && dotnet --version
COPY . .
COPY ./src/Ecotag/ClientApp/public/environment.docker.json ./src/Ecotag/ClientApp/public/environment.json
COPY ./src/Ecotag/ClientApp/public/OidcTrustedDomains.docker.js ./src/Ecotag/ClientApp/public/OidcTrustedDomains.js
RUN dotnet publish "./src/Ecotag/Ecotag.csproj" -c Release -r linux-x64 --self-contained=true /p:PublishSingleFile=true /p:PublishTrimmed=true /p:PublishReadyToRun=true -o /publish
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0 AS final
RUN apt update && apt-get install -y libreoffice
RUN libreoffice --version
RUN sed -i 's/UserInstallation/#UserInstallation/' /usr/lib/libreoffice/program/bootstraprc
WORKDIR /app
COPY --from=build /publish .
ENTRYPOINT /app/Ecotag ${APP_ARGS}