-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
49 lines (33 loc) · 1.12 KB
/
dockerfile
File metadata and controls
49 lines (33 loc) · 1.12 KB
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/nightly/sdk:9.0-noble-aot AS api
ARG VERSION=1.0.0
ARG APP_UID=1654
# Install native build tools required for NativeAOT
# RUN apt-get update && \
# apt-get install -y clang zlib1g-dev && \
# rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY api/*.csproj ./
RUN dotnet restore ./ -r linux-x64
COPY api/ ./
RUN dotnet publish -c Release --no-restore -o /build/publish /p:Version=${VERSION} -r linux-x64 ./
RUN ls -la /build/publish
FROM node:24-alpine AS app
WORKDIR /build
COPY app/package.json ./
COPY app/package-lock.json ./
RUN npm ci;
COPY app/ ./
RUN npm run build;
# FROM node:24-alpine AS user-setup
# ARG APP_UID=1654
# RUN addgroup -g ${APP_UID} appgroup && adduser -u ${APP_UID} -D appuser -G appgroup
FROM mcr.microsoft.com/dotnet/nightly/aspnet:9.0-noble-chiseled AS final
USER $APP_UID
WORKDIR /app
# Copy application files
COPY --chown=${APP_UID}:${APP_UID} --from=api /build/publish ./
COPY --chown=${APP_UID}:${APP_UID} --from=app /build/dist/kite/browser ./wwwroot/
# Have to use higher port due to non-root user
ENV ASPNETCORE_URLS="http://*:8080"
EXPOSE 8080
ENTRYPOINT ["/app/api"]