-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
49 lines (34 loc) · 1.48 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
43
44
45
46
47
48
49
FROM mcr.microsoft.com/dotnet/core/sdk:3.1.202 AS dev
WORKDIR /app
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt update && \
apt install -y --no-install-recommends nodejs make yarn apt-transport-https && \
rm -rf /var/lib/apt/lists/*
# COPY sln, prop files and makefile
COPY ./*.sln ./Common.props ./Directory.Build.props ./Makefile ./
# Install node modules
COPY ./src/WebTty.Hosting/Client/package.json \
./src/WebTty.Hosting/Client/yarn.lock \
./src/WebTty.Hosting/Client/Client.targets \
./src/WebTty.Hosting/Client/
RUN cd src/WebTty.Hosting/Client && yarn --frozen-lockfile --production=false && yarn cache clean
# Copy the main source project files
COPY src/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done
# Copy the test project files
COPY test/*/*.csproj ./
RUN for file in $(ls *.csproj); do mkdir -p test/${file%.*}/ && mv $file test/${file%.*}/; done
# COPY tools
COPY tools/jsonschema tools/jsonschema/
RUN dotnet restore
COPY . .
RUN make setup
FROM dev as build
RUN make package
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.4-alpine as runtime
ENV ASPNETCORE_URLS=""
WORKDIR /webtty
COPY --from=build /app/.build/bin/WebTty/Release/netcoreapp3.1/ .
ENTRYPOINT ["dotnet", "webtty.dll", "-a", "any"]