Skip to content

Commit

Permalink
Run bash scripts from the Dockerfile
Browse files Browse the repository at this point in the history
This avoids repeating the same dotnet build and restore command in the Dockerfile.
  • Loading branch information
MrDave1999 committed May 1, 2024
1 parent 087706d commit 037ad54
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,17 @@ COPY ["src/Plugins/SendGrid/*.csproj", "src/Plugins/SendGrid/"]
COPY ["src/Plugins/TwilioWhatsApp/*.csproj", "src/Plugins/TwilioWhatsApp/"]
COPY ["src/Plugins/IdentityDocumentEcuador/*.csproj", "src/Plugins/IdentityDocumentEcuador/"]
COPY ["src/Plugins/*.props", "src/Plugins/"]
WORKDIR /app/src/Plugins/AppointmentReminders
RUN dotnet restore
WORKDIR /app/src/Plugins/ChatBot
RUN dotnet restore
WORKDIR /app/src/Plugins/SendGrid
RUN dotnet restore
WORKDIR /app/src/Plugins/TwilioWhatsApp
RUN dotnet restore
WORKDIR /app/src/Plugins/IdentityDocumentEcuador
RUN dotnet restore
COPY ["src/Plugins/*.sh", "src/Plugins/"]
WORKDIR /app/src/Plugins
RUN chmod u+x restore-plugins.sh
RUN ["./restore-plugins.sh"]

# Copy everything else and build plugins
COPY ["src/Shared/", "/app/src/Shared/"]
COPY ["src/Plugins/", "/app/src/Plugins/"]
WORKDIR /app/src/Plugins/AppointmentReminders
RUN dotnet build -c Release --no-restore
WORKDIR /app/src/Plugins/ChatBot
RUN dotnet build -c Release --no-restore
WORKDIR /app/src/Plugins/SendGrid
RUN dotnet build -c Release --no-restore
WORKDIR /app/src/Plugins/TwilioWhatsApp
RUN dotnet build -c Release --no-restore
WORKDIR /app/src/Plugins/IdentityDocumentEcuador
RUN dotnet build -c Release --no-restore
WORKDIR /app/src/Plugins
RUN chmod u+x build-plugins.sh
RUN ["./build-plugins.sh"]

# Copy everything else and build app
COPY ["src/", "/app/src/"]
Expand Down

0 comments on commit 037ad54

Please sign in to comment.