Newsbot.Collector/Dockerfile

33 lines
732 B
Docker

#FROM golang:latest as goose
#RUN go install github.com/pressly/goose/v3/cmd/goose@latest
FROM mcr.microsoft.com/dotnet/sdk:7.0.103 as build
COPY . /app
WORKDIR /app
RUN dotnet restore
RUN dotnet build
FROM build AS publish
RUN dotnet publish -c Release -o /app/publish
RUN dotnet publish -o build
RUN ls build
FROM build as ef
RUN dotnet tool install dotnet-ef --tool-path /usr/bin --version 7.0.8
RUN dotnet ef migrations bundle --project "Newsbot.Collector.Database" --force
FROM mcr.microsoft.com/dotnet/aspnet:7.0.3 as app
ENV ASPNETCORE_URLS=http://*:5000
ENV DOTNET_URLS=http://*:5000
WORKDIR /app
COPY --from=publish /app/build /app
COPY --from=ef /app/efbundle /app
CMD [ "dotnet", "Newsbot.Collector.Api.dll" ]