build tweaks

This commit is contained in:
Michele Scandura 2020-11-30 11:20:35 +00:00
parent 3b273962cf
commit da302af8bf
6 changed files with 6 additions and 1209 deletions

View File

@ -33,6 +33,12 @@ steps:
- name: gitea_release
image: plugins/gitea-release
when:
event:
- tag
branch:
include:
- master
volumes:
- name: cache
path: /release

View File

@ -1,12 +1,9 @@
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
#FROM privateregistry.michelescandura.com/michele/basecompileimage as build
WORKDIR /src
# copy csproj and restore as distinct layers
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
# COPY Sledgemapper/*.csproj ./Sledgemapper/
WORKDIR /src/Sledgemapper.Api
RUN dotnet restore
@ -21,13 +18,7 @@ WORKDIR /src/Sledgemapper
WORKDIR /src
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
#COPY Sledgemapper/. ./Sledgemapper/
#WORKDIR /src/Sledgemapper
#COPY build.sh .
#RUN chmod +x build.sh
#RUN sh build.sh
WORKDIR /src/Sledgemapper.Api
RUN dotnet publish -c release -o /app --no-restore

View File

@ -1,37 +0,0 @@
#FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
FROM privateregistry.michelescandura.com/michele/basecompileimage as build
WORKDIR /src
# copy csproj and restore as distinct layers
#COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
COPY Sledgemapper/*.csproj ./Sledgemapper/
#WORKDIR /src/Sledgemapper.Api
#RUN dotnet restore
WORKDIR /src/Sledgemapper.Shared
RUN dotnet restore
WORKDIR /src/Sledgemapper
RUN dotnet restore
# copy everything else and build app
WORKDIR /src
#COPY Sledgemapper.Api/. ./Sledgemapper.Api/
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
COPY Sledgemapper/. ./Sledgemapper/
WORKDIR /src/Sledgemapper
COPY build.sh .
RUN chmod +x build.sh
RUN sh build.sh
#WORKDIR /src/Sledgemapper.Api
#RUN dotnet publish -c release -o /app --no-restore
# final stage/image
#FROM mcr.microsoft.com/dotnet/aspnet:5.0
#WORKDIR /app
#COPY --from=build /app ./
#ENTRYPOINT ["dotnet", "Sledgemapper.Api.dll"]

View File

@ -1,26 +0,0 @@
# https://hub.docker.com/_/microsoft-dotnet-core
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
WORKDIR /src
# copy csproj and restore as distinct layers
COPY Sledgemapper.Api/*.csproj ./Sledgemapper.Api/
COPY Sledgemapper.Shared/*.csproj ./Sledgemapper.Shared/
WORKDIR /src/Sledgemapper.Api
RUN dotnet restore
WORKDIR /src/Sledgemapper.Shared
RUN dotnet restore
# copy everything else and build app
WORKDIR /src
COPY Sledgemapper.Api/. ./Sledgemapper.Api/
COPY Sledgemapper.Shared/. ./Sledgemapper.Shared/
WORKDIR /src/Sledgemapper.Api
RUN dotnet publish -c release -o /app --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["dotnet", "Sledgemapper.Api.dll"]

View File

@ -1,29 +0,0 @@
# docker-compose.yml
version: '3'
services:
web:
build:
# build from Dockerfile
context: .
dockerfile: Dockerfile
ports:
- "5000:80"
# volumes:
# - .:.
redis:
image: redis
rabbitmq:
image: 'docker.io/bitnami/rabbitmq:3.8-debian-10'
ports:
- '4369:4369'
- '5672:5672'
- '25672:25672'
- '15672:15672'
volumes:
- 'rabbitmq_data:/bitnami'
volumes:
rabbitmq_data:
driver: local

1108
dotnet-install.sh vendored

File diff suppressed because it is too large Load Diff