|
| 1 | +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base |
| 2 | +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build |
| 3 | + |
| 4 | +ARG DEBIAN_FRONTEND=noninteractive |
| 5 | +RUN apt-get update \ |
| 6 | + && apt-get install -y --no-install-recommends ca-certificates curl unzip git build-essential \ |
| 7 | + && rm -rf /var/lib/apt/lists/* |
| 8 | + |
| 9 | +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ |
| 10 | + && apt-get install -y --no-install-recommends nodejs \ |
| 11 | + && corepack enable \ |
| 12 | + && corepack prepare pnpm@latest --activate \ |
| 13 | + && rm -rf /var/lib/apt/lists/* |
| 14 | + |
| 15 | +WORKDIR /src |
| 16 | + |
| 17 | +COPY frontend/package.json frontend/pnpm-lock.yaml ./frontend/ |
| 18 | +RUN cd frontend && pnpm install --frozen-lockfile |
| 19 | + |
| 20 | +COPY . . |
| 21 | + |
| 22 | +RUN make build |
| 23 | + |
| 24 | +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final |
| 25 | + |
| 26 | +ARG DEBIAN_FRONTEND=noninteractive |
| 27 | +RUN apt-get update \ |
| 28 | + && apt-get install -y --no-install-recommends make curl \ |
| 29 | + && rm -rf /var/lib/apt/lists/* |
| 30 | + |
| 31 | +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ |
| 32 | + && apt-get install -y --no-install-recommends nodejs \ |
| 33 | + && corepack enable \ |
| 34 | + && corepack prepare pnpm@latest --activate \ |
| 35 | + && rm -rf /var/lib/apt/lists/* |
| 36 | + |
| 37 | +WORKDIR /app |
| 38 | + |
| 39 | +COPY Makefile ./ |
| 40 | +COPY --from=build /src/frontend/.next ./frontend/.next |
| 41 | +COPY --from=build /src/frontend/public ./frontend/public |
| 42 | +COPY --from=build /src/frontend/package.json ./frontend/ |
| 43 | +COPY --from=build /src/frontend/node_modules ./frontend/node_modules |
| 44 | +COPY --from=build /src/frontend/Makefile ./frontend/Makefile |
| 45 | + |
| 46 | +COPY --from=build /src/compiler/bin/Release/net9.0/ /app/compiler/bin/Release/net9.0/ |
| 47 | + |
| 48 | +ENV NODE_ENV=production \ |
| 49 | + NEXT_TELEMETRY_DISABLED=1 \ |
| 50 | + COMPILER_PATH=/app/compiler/bin/Release/net9.0/CompilersApp \ |
| 51 | + PORT=3000 \ |
| 52 | + HOST=0.0.0.0 |
| 53 | + |
| 54 | +EXPOSE 3000 |
| 55 | + |
| 56 | +CMD ["make","start"] |
0 commit comments