|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base |
|
WORKDIR /app |
|
EXPOSE 7860 |
|
|
|
ENV ASPNETCORE_URLS=http://0.0.0.0:7860 |
|
ENV ConnectionStrings__DefaultConnection="Host=aws-0-eu-central-1.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.hpbtdersdvvpxrkmhbfe;Password=009988Ppooii@@@@" |
|
ENV JWT__KEY="YourSecretKey123!@#$%^&*()+=-0987654321" |
|
ENV JWT__ISSUER="your-issuer" |
|
ENV JWT__AUDIENCE="your-audience" |
|
ENV DB_HOST="aws-0-eu-central-1.pooler.supabase.com" |
|
ENV DB_PORT="5432" |
|
ENV DB_NAME="postgres" |
|
ENV DB_USER="postgres.hpbtdersdvvpxrkmhbfe" |
|
ENV DB_PASSWORD="009988Ppooii@@@@" |
|
|
|
|
|
|
|
|
|
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build |
|
WORKDIR /src |
|
COPY ["Backend.csproj", "./"] |
|
RUN dotnet restore "Backend.csproj" |
|
COPY . . |
|
|
|
|
|
|
|
|
|
RUN dotnet tool install --global dotnet-ef |
|
ENV PATH="${PATH}:/root/.dotnet/tools" |
|
ENV ConnectionStrings__DefaultConnection="Host=aws-0-eu-central-1.pooler.supabase.com;Port=5432;Database=postgres;Username=postgres.hpbtdersdvvpxrkmhbfe;Password=009988Ppooii@@@@" |
|
ENV JWT__KEY="YourSecretKey123!@#$%^&*()+=-0987654321" |
|
ENV JWT__ISSUER="your-issuer" |
|
ENV JWT__AUDIENCE="your-audience" |
|
|
|
RUN dotnet ef migrations add InitialMigration --project Backend.csproj |
|
|
|
RUN dotnet build "Backend.csproj" -c Release -o /app/build |
|
|
|
FROM build AS publish |
|
RUN dotnet publish "Backend.csproj" -c Release -o /app/publish |
|
|
|
FROM base AS final |
|
WORKDIR /app |
|
COPY --from=publish /app/publish . |
|
|
|
|
|
COPY --from=build /src/Migrations ./Migrations |
|
COPY --from=build /src/*.db ./ |
|
|
|
|
|
COPY <<EOF /app/entrypoint.sh |
|
|
|
set -e |
|
|
|
|
|
sleep 5 |
|
|
|
|
|
dotnet Backend.dll migrate |
|
|
|
|
|
dotnet Backend.dll |
|
EOF |
|
|
|
RUN chmod +x /app/entrypoint.sh |
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"] |
|
|
|
|
|
|