diff --git a/.drone.yml b/.drone.yml index 9b66163..12aba23 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,6 @@ kind: pipeline type: docker -name: "Build and test" +name: "Backend" steps: - name: test @@ -8,3 +8,13 @@ steps: commands: - dotnet build - dotnet test + +- name: publish + image: plugins/docker + settings: + username: prtsie + password: + from_secret: docker_pass + repo: prtsie/schengen-visa + tags: + - latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..73fde84 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +WORKDIR /src +COPY . ./ +RUN dotnet restore +RUN dotnet publish "SchengenVisaApi/SchengenVisaApi.csproj" -c Release -o /app/publish + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime +WORKDIR /app +COPY --from=build /app/publish ./ +ENV ASPNETCORE_URLS=https://*:5000 +EXPOSE 5000 +ENTRYPOINT ["dotnet", "SchengenVisaApi.dll"]