2023-06-19 15:38:33 -07:00
|
|
|
#FROM golang:latest as goose
|
2023-03-11 10:43:06 -08:00
|
|
|
|
2023-06-19 15:38:33 -07:00
|
|
|
#RUN go install github.com/pressly/goose/v3/cmd/goose@latest
|
2023-03-11 10:43:06 -08:00
|
|
|
|
|
|
|
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
|
|
|
|
#--self-contained true -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
|
|
|
|
RUN ls build
|
|
|
|
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0.3 as app
|
|
|
|
|
|
|
|
ENV ASPNETCORE_URLS=http://*:5000
|
|
|
|
ENV DOTNET_URLS=http://*:5000
|
|
|
|
|
|
|
|
#RUN apt-get install chromium -y
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-06-19 15:38:33 -07:00
|
|
|
#RUN mkdir /migrations
|
2023-03-11 10:43:06 -08:00
|
|
|
COPY --from=publish /app/build /app
|
2023-06-19 15:38:33 -07:00
|
|
|
#COPY --from=build ./app/Newsbot.Collector.Database/Migrations /app/migrations
|
|
|
|
#COPY --from=goose /go/bin/goose /app
|
2023-03-11 10:43:06 -08:00
|
|
|
|
2023-03-31 22:49:39 -07:00
|
|
|
CMD [ "dotnet", "Newsbot.Collector.Api.dll" ]
|