0
0

Docker update

This commit is contained in:
Serghei Cebotari 2024-01-29 16:32:38 +03:00
parent a9eb0eb37d
commit 87f854bb15
2 changed files with 16 additions and 24 deletions

View File

@ -1,19 +1,15 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build FROM mcr.microsoft.com/dotnet/sdk:8.0-jammy AS build
WORKDIR /app WORKDIR /source
COPY . ./ COPY . .
RUN dotnet restore RUN dotnet restore && \
RUN dotnet tool restore dotnet tool restore && \
RUN dotnet libman restore dotnet libman restore
RUN dotnet ef database update --context DataContext RUN dotnet publish --property:OutputPath=/app
RUN dotnet ef database update --context IdentityContext
RUN dotnet publish -c Release -o out FROM mcr.microsoft.com/dotnet/aspnet:8.0-jammy
FROM mcr.microsoft.com/dotnet/aspnet:6.0
EXPOSE 5000 EXPOSE 5000
WORKDIR /app WORKDIR /app
COPY --from=build /app/out . COPY --from=build /app .
COPY --from=build /app/Database ./Database
ENV ASPNETCORE_ENVIRONMENT Production ENV ASPNETCORE_ENVIRONMENT Production
ENTRYPOINT [ "dotnet", "MyDarling.dll", "--urls=http://0.0.0.0:5000" ] ENTRYPOINT [ "./MyDarling", "--urls=http://0.0.0.0:5000" ]

View File

@ -1,17 +1,13 @@
version: '3' version: '3'
services: services:
my-darling: my-darling-test:
image: gitea.cebotari.ru/chebser/mydarling-dotnet:latest build: .
container_name: mydarling-dotnet container_name: mydarling-dotnet
ports: ports:
- "5050:5000" - "5000:5000"
volumes: volumes:
- db:/app/Database - ./Database:/app/Database
- content:/app/wwwroot/Content - ./wwwroot/Content:/app/wwwroot/Content
environment: environment:
- ADMIN_PASSWORD=He110World! - ADMIN_PASSWORD=He110World!
volumes:
db:
content: