diff options
author | Serghei Cebotari <serghei@cebotari.ru> | 2024-01-29 16:32:38 +0300 |
---|---|---|
committer | Serghei Cebotari <serghei@cebotari.ru> | 2024-01-29 16:32:38 +0300 |
commit | 87f854bb151d314d21237a67d92d31e2ddac152a (patch) | |
tree | ef42a1887133b43bb1f21997281380c7526607af | |
parent | a9eb0eb37d2cbdffb5381594a9b99ad14896c522 (diff) |
Docker update
-rw-r--r-- | Dockerfile | 24 | ||||
-rw-r--r-- | docker-compose.yml | 16 |
2 files changed, 16 insertions, 24 deletions
@@ -1,19 +1,15 @@ -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build -WORKDIR /app - -COPY . ./ -RUN dotnet restore -RUN dotnet tool restore -RUN dotnet libman restore -RUN dotnet ef database update --context DataContext -RUN dotnet ef database update --context IdentityContext +FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build +WORKDIR /source -RUN dotnet publish -c Release -o out +COPY . . +RUN dotnet restore && \ + dotnet tool restore && \ + dotnet libman restore +RUN dotnet publish --property:OutputPath=/app -FROM mcr.microsoft.com/dotnet/aspnet:6.0 +FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy EXPOSE 5000 WORKDIR /app -COPY --from=build /app/out . -COPY --from=build /app/Database ./Database +COPY --from=build /app . ENV ASPNETCORE_ENVIRONMENT Production -ENTRYPOINT [ "dotnet", "MyDarling.dll", "--urls=http://0.0.0.0:5000" ]
\ No newline at end of file +ENTRYPOINT [ "./MyDarling", "--urls=http://0.0.0.0:5000" ] diff --git a/docker-compose.yml b/docker-compose.yml index dae7f88..728c420 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,13 @@ version: '3' services: - my-darling: - image: gitea.cebotari.ru/chebser/mydarling-dotnet:latest + my-darling-test: + build: . container_name: mydarling-dotnet ports: - - "5050:5000" + - "5000:5000" volumes: - - db:/app/Database - - content:/app/wwwroot/Content + - ./Database:/app/Database + - ./wwwroot/Content:/app/wwwroot/Content environment: - - ADMIN_PASSWORD=He110World! - -volumes: - db: - content:
\ No newline at end of file + - ADMIN_PASSWORD=He110World!
\ No newline at end of file |