-
Notifications
You must be signed in to change notification settings - Fork 0
/
Containerfile.www
53 lines (38 loc) · 1.35 KB
/
Containerfile.www
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
50
51
52
53
# https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-3.1
# https://github.com/dotnet/dotnet-docker/blob/master/samples/aspnetapp/Dockerfile.alpine-x64
FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine-amd64 AS build
RUN apk --no-cache add \
bash \
findutils \
g++ \
make \
nodejs \
rsync \
sed
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -
RUN sh -c 'source /root/.shrc && pnpm install -g clean-css-cli uglify-js'
WORKDIR /src
COPY _client_app_vars.sh .
COPY _build.sh .
COPY build_client_apps.sh .
COPY mikeandwan.us.sln .
COPY nuget.config .
COPY src/. src/
COPY tests/. tests/
ENV NG_CLI_ANALYTICS=ci
RUN sh -c 'source /root/.shrc && ./_build.sh www'
# build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine-amd64
RUN apk --no-cache add \
bash \
ca-certificates \
file
WORKDIR /maw-www
COPY --from=build /src/dist .
COPY _start_site_in_container.sh /usr/local/bin/
EXPOSE 5021
# TODO: cant specify user yet given how we currently deal with certificates as it tries to write to filesystem:
# cp: can't create '/usr/local/share/ca-certificates/ca_2022-05-12.crt': Permission denied
#USER app
ENTRYPOINT [ "_start_site_in_container.sh" ]
CMD [ "./MawWww" ]