Handle connection string for migrations

This commit is contained in:
Zoe Roux 2024-03-25 23:41:00 +01:00
parent 646df0f393
commit ea979d9663
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View File

@ -19,7 +19,7 @@ COPY . .
ARG VERSION
RUN dotnet publish -a $TARGETARCH --no-restore -c Release -o /app "-p:Version=${VERSION:-"0.0.0-dev"}" src/Kyoo.Host
FROM mcr.microsoft.com/dotnet/aspnet:7.0
FROM mcr.microsoft.com/dotnet/aspnet:8.0
RUN apt-get update && apt-get install -y curl
COPY --from=builder /app /app

View File

@ -7,6 +7,7 @@ RUN dotnet tool restore
COPY . .
RUN dotnet ef migrations bundle --self-contained -f -o /app/migrate -p src/Kyoo.Postgresql --verbose
FROM alpine
COPY --from=builder /app /app
ENTRYPOINT ["/app/migrate"]
FROM mcr.microsoft.com/dotnet/runtime-deps:8.0
COPY --from=builder /app/migrate /app/migrate
ENTRYPOINT /app/migrate --connection "USER ID=${POSTGRES_USER};PASSWORD=${POSTGRES_PASSWORD};SERVER=postgres;PORT=5432;DATABASE=${POSTGRES_DB};"