-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (36 loc) · 1.61 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
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build
WORKDIR /app
RUN apt-get update
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=18
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get install -y --no-install-recommends nodejs \
&& echo "node version: $(node --version)" \
&& echo "npm version: $(npm --version)" \
&& rm -rf /var/lib/apt/lists/*
COPY . .
RUN dotnet restore
WORKDIR /app/MusicTypeChat
RUN npm cache clean --force
RUN npm install node-fetch
RUN node postinstall.js && npm run build
RUN dotnet publish -c release -o /out --no-restore
FROM mcr.microsoft.com/dotnet/aspnet:6.0-focal AS runtime
WORKDIR /app
COPY --from=build /out ./
RUN apt-get update
RUN apt-get install -y ca-certificates curl gnupg
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
ENV NODE_MAJOR=18
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update
RUN apt-get install -y --no-install-recommends nodejs \
&& echo "node version: $(node --version)" \
&& echo "npm version: $(npm --version)" \
&& rm -rf /var/lib/apt/lists/*
RUN npm install --ignore-scripts
ENTRYPOINT ["dotnet", "MusicTypeChat.dll"]