Dockerfile in nopcommerce in cloud run

1 week ago
Someone by chance has already installed nop in Cloud Run from Google Cloud Platform, I'm in a dilemma because my application even after deployment it is in a /install loop, and the database is already configured, look at the dockerfile I'm with using:

FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build

WORKDIR /src
COPY ./src ./

RUN dotnet restore NopCommerce.sln
WORKDIR /src/Presentation/Nop.Web

# build project
RUN dotnet build Nop.Web.csproj -c Release

#WORKDIR /src/Plugins/Nop.Plugin.DiscountRules.CustomerRoles
#RUN dotnet build Nop.Plugin.DiscountRules.CustomerRoles.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.ExchangeRate.EcbExchange
#RUN dotnet build Nop.Plugin.ExchangeRate.EcbExchange.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.ExternalAuth.Facebook
#RUN dotnet build Nop.Plugin.ExternalAuth.Facebook.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Misc.Sendinblue
#RUN dotnet build Nop.Plugin.Misc.Sendinblue.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.CheckMoneyOrder
#RUN dotnet build Nop.Plugin.Payments.CheckMoneyOrder.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.Manual
#RUN dotnet build Nop.Plugin.Payments.Manual.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalCommerce
#RUN dotnet build Nop.Plugin.Payments.PayPalCommerce.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Payments.PayPalStandard
#RUN dotnet build Nop.Plugin.Payments.PayPalStandard.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Pickup.PickupInStore
#RUN dotnet build Nop.Plugin.Pickup.PickupInStore.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Shipping.FixedByWeightByTotal
#RUN dotnet build Nop.Plugin.Shipping.FixedByWeightByTotal.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Shipping.ShipStation
#RUN dotnet build Nop.Plugin.Shipping.ShipStation.csproj -c Release
#RUN dotnet build Nop.Plugin.Widgets.NivoSlider.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Shipping.UPS
#RUN dotnet build Nop.Plugin.Shipping.UPS.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Tax.Avalara
#RUN dotnet build Nop.Plugin.Tax.Avalara.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Tax.FixedOrByCountryStateZip
#RUN dotnet build Nop.Plugin.Tax.FixedOrByCountryStateZip.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.AccessiBe
#RUN dotnet build Nop.Plugin.Widgets.AccessiBe.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.FacebookPixel
#RUN dotnet build Nop.Plugin.Widgets.FacebookPixel.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.GoogleAnalytics
#RUN dotnet build Nop.Plugin.Widgets.GoogleAnalytics.csproj -c Release
#WORKDIR /src/Plugins/Nop.Plugin.Widgets.NivoSlider

# publish project
WORKDIR /src/Presentation/Nop.Web
RUN dotnet publish Nop.Web.csproj -c Release -o /app/published

# create the runtime instance
FROM mcr.microsoft.com/dotnet/aspnet:5.0-alpine AS runtime

# add globalization support
RUN apk add --no-cache icu-libs
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false

# installs required packages
RUN apk add libgdiplus --no-cache --repository http://dl-3.alpinelinux.org/alpine/edge/testing/ --allow-untrusted
RUN apk add libc-dev --no-cache

# copy entrypoint script
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh

WORKDIR /app
RUN mkdir bin
RUN mkdir logs

# create empty App_Data/datasettings.json to allow using datasettings environment variables
RUN mkdir App_Data
WORKDIR /app/App_Data
RUN echo "" > dataSettings.json
RUN echo "" > appSettings.json
WORKDIR /app
                                                            
COPY --from=build /app/published .
                            
ENTRYPOINT "/entrypoint.sh"
1 week ago
Hi raul.xavier. We already have a ticket with this problem, only on another cloud service. Unfortunately, we were unable to reproduce the problem. Since you are installing the site not from a docker hub try to change the docker file by adding the setting of rights to the dataSettings.json and appSettings.json files, I think 755 should work.