-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (27 loc) · 1.11 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
# BUILD SERVER
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim AS server-builder
ADD ./vsfh-server /vsfh-server
WORKDIR /vsfh-server
RUN dotnet restore
RUN dotnet publish -c Release -o build --use-current-runtime -p:PublishReadyToRun=true --no-self-contained
# BUILD CLIENT
FROM docker.io/node:18-slim AS client-builder
ADD ./vsfh-client /vsfh-client
WORKDIR /vsfh-client
RUN yarn install --frozen-lockfile
# See https://github.com/webpack/webpack/issues/14532
# The build process calls Object.createHash, which in node is implemented via openssl
RUN export NODE_OPTIONS=--openssl-legacy-provider && yarn run build
# COMPRESS CLIENT
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim AS compressor
ADD ./vsfh-compressor /vsfh-compressor
COPY --from=client-builder /vsfh-client/build /vsfh-client
WORKDIR /vsfh-compressor
RUN dotnet run -c Release -- --path /vsfh-client
# BUILD RUNTIME ENVIRONMENT
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim
WORKDIR /vsfh
COPY --from=server-builder /vsfh-server/build .
COPY --from=compressor /vsfh-client ./wwwroot
RUN mkdir data
ENTRYPOINT [ "/vsfh/VerySimpleFileHost" ]