diff --git a/api/Dockerfile b/api/Dockerfile new file mode 100644 index 00000000..26c14b55 --- /dev/null +++ b/api/Dockerfile @@ -0,0 +1,29 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +WORKDIR /app +EXPOSE 8080 +ENV ASPNETCORE_URLS=http://*:8080 +ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true +ENV DOTNET_gcServer=1 +ARG VERSION +ENV VERSION=$VERSION + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build + +WORKDIR /src + +COPY ["api/api.csproj", "api/"] +COPY ["db/db.csproj", "db/"] +RUN dotnet restore api/api.csproj +RUN dotnet restore db/db.csproj +COPY . . +RUN dotnet build "api/api.csproj" -c Release +# build +FROM build AS publish +RUN dotnet publish "api/api.csproj" -c Release -o /app/publish --runtime linux-musl-x64 --no-self-contained + +FROM base AS final + +# copy app +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "api.dll"] \ No newline at end of file diff --git a/web/Dockerfile.node b/web/Dockerfile.node new file mode 100644 index 00000000..7d95c7b0 --- /dev/null +++ b/web/Dockerfile.node @@ -0,0 +1,10 @@ +FROM centos/nodejs-10-centos7:10 +ARG WEB_BASE_HREF +ENV WEB_BASE_HREF="$WEB_BASE_HREF" +ENV WEB1_BASE_HREF="$WEB_BASE_HREF" +WORKDIR /opt/app-root/src +COPY . . +RUN echo "$WEB1_BASE_HREF" +RUN echo "$WEB_BASE_HREF" +RUN npm install +RUN npm run build \ No newline at end of file