File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
src/Presentation/BookLibraryAPI.Presentation Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,14 @@ WORKDIR /app
33EXPOSE 8080
44EXPOSE 9443
55
6+
67# Copy dev certificate
78COPY ./src/Presentation/BookLibraryAPI.Presentation/aspnet-dev-cert.pfx /https/aspnet-dev-cert.pfx
89
10+ # Copy wait-for-postgres script
11+ COPY ../../wait-for-postgres.sh /app/wait-for-postgres.sh
12+ RUN chmod +x /app/wait-for-postgres.sh
13+
914FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
1015ARG BUILD_CONFIGURATION=Release
1116WORKDIR /src
@@ -22,4 +27,4 @@ RUN dotnet publish "./BookLibraryAPI.Presentation.csproj" -c $BUILD_CONFIGURATIO
2227FROM base AS final
2328WORKDIR /app
2429COPY --from=publish /app/publish .
25- ENTRYPOINT ["dotnet " , "BookLibraryAPI.Presentation.dll" ]
30+ ENTRYPOINT ["/bin/sh " , "-c" , "/app/wait-for-postgres.sh dotnet BookLibraryAPI.Presentation.dll" ]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ until pg_isready -h book-lib-postgres -p 5432 -U postgres; do
3+ echo " Waiting for postgres..."
4+ sleep 2
5+ done
6+ exec " $@ "
You can’t perform that action at this time.
0 commit comments