Hacker News new | ask | show | jobs
by romanovcode 2741 days ago
Using .NET Core on production here.

> but delivering solutions on time and with minimum maintenance requirements afterward is just easier in python or JAVA

I would agree if you would replace Python/Java with Node, but with these languages I don't see it.

> on time and with minimum maintenance requirements afterward

This is my Dockerfile, it is serving me without changes (technically replacing 2.1 with 2.2 is a change) for more than 6 months.

    # Build assets
    FROM node:8-alpine AS assets
    WORKDIR /app
    COPY src/Website/Package.json ./Website/package.json
    COPY src/Website/Gulpfile.js ./Website/
    COPY src/Website/Static/. ./Website/Static
    WORKDIR /app/Website
    RUN npm install
    RUN npm run build

    # Build project
    FROM microsoft/dotnet:2.2-sdk-alpine AS build
    WORKDIR /app
    COPY src/Website/*.csproj ./Website/
    WORKDIR /app/Website
    RUN dotnet restore
    WORKDIR /app
    COPY src/Website/. ./Website/
    WORKDIR /app/Website
    RUN dotnet publish -c Release -o dist

    # Run project
    FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine AS runtime
    WORKDIR /app
    COPY --from=build /app/Website/dist ./
    COPY --from=assets /app/Website/Static/dist ./Static/dist
    RUN rm /app/Data/Log/.gitkeep

    ENTRYPOINT ["dotnet", "Website.dll"]

>But maybe I’m missing something?

I think you might be.