Optimizing drone compiling
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
10
.drone.yml
10
.drone.yml
@@ -3,11 +3,6 @@ type: docker
|
|||||||
name: default
|
name: default
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-dotnet
|
|
||||||
image: alpine
|
|
||||||
commands:
|
|
||||||
- echo "Docker build will handle dotnet publish"
|
|
||||||
|
|
||||||
- name: build-docker
|
- name: build-docker
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
@@ -21,8 +16,13 @@ steps:
|
|||||||
context: .
|
context: .
|
||||||
tags:
|
tags:
|
||||||
- latest
|
- latest
|
||||||
|
- ${DRONE_COMMIT_SHA:0:7}
|
||||||
|
cache_from:
|
||||||
|
- 192.168.1.9:3000/tai/aberwyn/aberwyn:latest
|
||||||
insecure: true
|
insecure: true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: restart-unraid-container
|
- name: restart-unraid-container
|
||||||
image: appleboy/drone-ssh
|
image: appleboy/drone-ssh
|
||||||
settings:
|
settings:
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
|
# Basimage för runtime
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||||
|
|
||||||
|
# Installera svenska språkinställningar
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y locales && \
|
apt-get install -y locales && \
|
||||||
locale-gen sv_SE.UTF-8
|
locale-gen sv_SE.UTF-8
|
||||||
|
|
||||||
|
# Ställ in svenska som standard
|
||||||
ENV LANG=sv_SE.UTF-8
|
ENV LANG=sv_SE.UTF-8
|
||||||
ENV LANGUAGE=sv_SE:sv
|
ENV LANGUAGE=sv_SE:sv
|
||||||
ENV LC_ALL=sv_SE.UTF-8
|
ENV LC_ALL=sv_SE.UTF-8
|
||||||
@@ -13,18 +16,30 @@ WORKDIR /app
|
|||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
EXPOSE 443
|
EXPOSE 443
|
||||||
|
|
||||||
|
# Byggimage med SDK
|
||||||
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Kopiera endast .csproj först för att kunna cacha restore
|
||||||
COPY ["Aberwyn/Aberwyn.csproj", "Aberwyn/"]
|
COPY ["Aberwyn/Aberwyn.csproj", "Aberwyn/"]
|
||||||
WORKDIR /src/Aberwyn
|
WORKDIR /src/Aberwyn
|
||||||
|
|
||||||
|
# Restore beroenden
|
||||||
RUN dotnet restore "Aberwyn.csproj"
|
RUN dotnet restore "Aberwyn.csproj"
|
||||||
|
|
||||||
|
# Kopiera övrig kod
|
||||||
COPY Aberwyn/. .
|
COPY Aberwyn/. .
|
||||||
RUN dotnet build "Aberwyn.csproj" -c Release -o /app/build
|
|
||||||
|
|
||||||
|
# Bygg utan att köra restore igen
|
||||||
|
RUN dotnet build "Aberwyn.csproj" -c Release -o /app/build --no-restore
|
||||||
|
|
||||||
|
# Publicera utan att köra restore eller build igen
|
||||||
FROM build AS publish
|
FROM build AS publish
|
||||||
RUN dotnet publish "Aberwyn.csproj" -c Release -o /app/publish
|
RUN dotnet publish "Aberwyn.csproj" -c Release -o /app/publish --no-restore
|
||||||
|
|
||||||
|
# Slutgiltig image baserad på runtime
|
||||||
FROM base AS final
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=publish /app/publish .
|
COPY --from=publish /app/publish .
|
||||||
|
|
||||||
ENTRYPOINT ["dotnet", "Aberwyn.dll"]
|
ENTRYPOINT ["dotnet", "Aberwyn.dll"]
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
color: rgb(80, 0, 0);
|
color: rgb(160, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -258,7 +258,7 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
100% {
|
100% {
|
||||||
color: rgb(0, 80, 0);
|
color: rgb(0, 160, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user