-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile.api
40 lines (28 loc) · 1.06 KB
/
Containerfile.api
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
# 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
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/
RUN ./_build.sh api
# build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine-amd64
RUN apk --no-cache add \
bash \
ca-certificates \
file
WORKDIR /maw-api
COPY --from=build /src/dist .
COPY _start_site_in_container.sh /usr/local/bin/
EXPOSE 5011
# 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 [ "./MawApi" ]