From 383ef0b0fbc284e143571bfa521c64503385b379 Mon Sep 17 00:00:00 2001 From: Nguyen Xuan Nhan Date: Sat, 30 Sep 2023 18:15:53 +0700 Subject: [PATCH] update Dockerfile --- apps/Profio.Website/Dockerfile | 4 ---- apps/cms/Dockerfile | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/Profio.Website/Dockerfile b/apps/Profio.Website/Dockerfile index 7ce13206..ea4e3036 100644 --- a/apps/Profio.Website/Dockerfile +++ b/apps/Profio.Website/Dockerfile @@ -1,5 +1,3 @@ -#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. - FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base WORKDIR /app EXPOSE 80 @@ -7,8 +5,6 @@ EXPOSE 443 FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src -COPY ["Directory.Build.props", "."] -COPY ["Directory.Build.targets", "."] COPY ["apps/Profio.Website/Profio.Website.csproj", "apps/Profio.Website/"] RUN dotnet restore "apps/Profio.Website/Profio.Website.csproj" COPY . . diff --git a/apps/cms/Dockerfile b/apps/cms/Dockerfile index 490b04c8..64162629 100644 --- a/apps/cms/Dockerfile +++ b/apps/cms/Dockerfile @@ -5,6 +5,9 @@ WORKDIR /usr/src/app COPY dist/apps/cms/package*.json ./ RUN npm install --only=production -f +RUN mkdir /temp_copy +COPY dist/apps/cms/.next /temp_copy + FROM docker.io/node:lts-alpine as runner RUN apk add --no-cache dumb-init ENV NODE_ENV production @@ -15,8 +18,7 @@ ENV NEXT_TELEMETRY_DISABLED 1 WORKDIR /usr/src/app COPY --from=deps /usr/src/app/node_modules ./node_modules COPY --from=deps /usr/src/app/package.json ./package.json -COPY dist/apps/cms/public ./public -COPY dist/apps/cms/.next ./.next +COPY --from=deps /temp_copy/.next ./.next RUN chown -R node:node . USER node EXPOSE 3000