-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
29 lines (24 loc) · 950 Bytes
/
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
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app
# Prevent 'Warning: apt-key output should not be parsed (stdout is not a terminal)'
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1
# install NodeJS 13.x
# see https://github.com/nodesource/distributions/blob/master/README.md#deb
RUN apt-get update -yq
RUN apt-get install curl gnupg -yq
RUN curl -sL https://deb.nodesource.com/setup_13.x | bash -
RUN apt-get install -y nodejs
RUN apt-get install -y build-essential
# Copy csproj and restore as distinct layers
COPY . .
RUN dotnet restore "/app/teslacamviewer.web/teslacamviewer.web.csproj"
# Copy everything else and build
COPY ./ ./
RUN dotnet publish "/app/teslacamviewer.web/teslacamviewer.web.csproj" -c Release -o out
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:5.0
RUN mkdir /teslacamdata
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "teslacamviewer.web.dll"]