diff --git a/Dockerfile b/Dockerfile index 6b32b62..834e783 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ +############################################################################### FROM mcr.microsoft.com/dotnet/sdk:8.0.301-alpine3.19-amd64 AS base ENV WORKDIR=/app WORKDIR ${WORKDIR} +############################################################################### FROM node:22.2.0-alpine3.19 AS lint ENV WORKDIR=/app @@ -19,10 +21,12 @@ COPY ./docs ${WORKDIR}/docs RUN apk add --update --no-cache make RUN npm install -g --ignore-scripts markdownlint-cli +############################################################################### FROM base AS development RUN apk add --update --no-cache make +############################################################################### FROM development AS builder COPY ./algorithm-exercises-csharp ${WORKDIR}/algorithm-exercises-csharp @@ -30,6 +34,7 @@ COPY ./algorithm-exercises-csharp.sln ${WORKDIR}/algorithm-exercises-csharp.sln COPY ./Makefile ${WORKDIR}/ RUN ls -alh +############################################################################### ### In testing stage, can't use USER, due permissions issue ## in github actions environment: ## @@ -47,6 +52,7 @@ RUN ls -alh CMD ["dotnet", "test"] +############################################################################### ### In production stage ## in the production phase, "good practices" such as ## WORKSPACE and USER are maintained