diff --git a/mohaymen-codestar-Team02/Dockerfile b/mohaymen-codestar-Team02/Dockerfile index e0dec06..f928432 100644 --- a/mohaymen-codestar-Team02/Dockerfile +++ b/mohaymen-codestar-Team02/Dockerfile @@ -3,16 +3,11 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /app -ENV PATH="${PATH}:/root/.dotnet/tools" -RUN dotnet tool install --global dotnet-ef - COPY *.csproj . RUN dotnet restore COPY . . -RUN dotnet build -c Release -RUN dotnet ef migrations bundle --no-build -o dbmigrate -RUN dotnet publish -c Release -o output --no-build +RUN dotnet publish -c Release -o output # # @@ -24,10 +19,9 @@ USER app WORKDIR /app -COPY --chown=app:app --from=build /app/output /app/dbmigrate /app/ -COPY --chown=app:app ./entrypoint.sh /app/entrypoint.sh +COPY --chown=app:app --from=build /app/output . -ENTRYPOINT ["bash", "/app/entrypoint.sh"] +ENTRYPOINT ["dotnet", "mohaymen-codestar-Team02.dll"] EXPOSE 8080 diff --git a/mohaymen-codestar-Team02/appsettings.json b/mohaymen-codestar-Team02/appsettings.json new file mode 100644 index 0000000..1c08b37 --- /dev/null +++ b/mohaymen-codestar-Team02/appsettings.json @@ -0,0 +1,12 @@ +{ + "AppSettings": { + "Token": "my top secret key is right here hehe jkjkjkj yguguygugyuguyguuygggyuguyuygu jhj" + }, + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/mohaymen-codestar-Team02/entrypoint.sh b/mohaymen-codestar-Team02/entrypoint.sh deleted file mode 100644 index b59186a..0000000 --- a/mohaymen-codestar-Team02/entrypoint.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash -set -e - -BASE_DIR=$(dirname "$0") - -migrate() { - echo "Migrating database" - "${BASE_DIR}/dbmigrate" $@ -} - -run() { - echo "Running application" - dotnet "$BASE_DIR/mohaymen-codestar-Team02.dll" -} - - -case "$1" in -migrate) - additional_args=${@:2} - migrate $additional_args - ;; -run) - run - ;; -*) - migrate - run - ;; -esac diff --git a/mohaymen-codestar-Team02/prod.env.example b/mohaymen-codestar-Team02/prod.env.example index dec8fc5..e3b49ab 100644 --- a/mohaymen-codestar-Team02/prod.env.example +++ b/mohaymen-codestar-Team02/prod.env.example @@ -1,2 +1,2 @@ ASPNETCORE_ENVIRONMENT=Release -CONNECTION_STRING="Host=postgres;Port=5432;Database=mohaymen_group02_project;Username=pguser;Password=pgpass;" +ConnectionStrings__DefaultConnection="Host=postgres;Port=5432;Database=mohaymen_group02_project;Username=pguser;Password=pgpass;"