Remove separate Dockerfiles.

This commit is contained in:
West14
2022-01-10 01:16:46 +02:00
parent dbd4b73a32
commit a9deb52953
4 changed files with 0 additions and 90 deletions
-2
View File
@@ -33,8 +33,6 @@ jobs:
name: Build and push name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/dev' }} push: ${{ github.ref == 'refs/heads/dev' }}
tags: ${{ secrets.REGISTRY_URL }}/west/telegram-bot:latest, tags: ${{ secrets.REGISTRY_URL }}/west/telegram-bot:latest,
View File
-44
View File
@@ -1,44 +0,0 @@
# Build a project
FROM mcr.microsoft.com/dotnet/sdk:6.0.101-alpine3.14-amd64 AS build
WORKDIR /source
# Copy project and perform restoring
COPY Kruzya.TelegramBot.sln ./
COPY ./Core/*.csproj ./Core/
COPY ./tests/*.csproj ./tests/
COPY ./modules/CombotAntiSpam/*.csproj ./modules/CombotAntiSpam/
COPY ./modules/Destiny2.WhereIsXur/*.csproj ./modules/Destiny2.WhereIsXur/
COPY ./modules/RichSiteSummary/*.csproj ./modules/RichSiteSummary/
COPY ./modules/UrlLimitations/*.csproj ./modules/UrlLimitations/
COPY ./modules/ChatManagement/*.csproj ./modules/ChatManagement/
COPY ./modules/Entertainment/*.csproj ./modules/Entertainment/
COPY ./modules/UserGroupTag/*.csproj ./modules/UserGroupTag/
RUN dotnet restore Kruzya.TelegramBot.sln
# Copy all project files
COPY . .
RUN dotnet publish -c release -o /app --no-restore Kruzya.TelegramBot.sln && \
mkdir /app/modules && \
cp /app/TelegramBot.*.dll /app/modules/ && \
rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
# Now reuse image with only runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0.101-alpine3.14-amd64
WORKDIR /user
COPY --from=build /app /app
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN apk add --no-cache cmake make musl-dev gcc gettext-dev libintl icu-libs \
&& wget https://gitlab.com/rilian-la-te/musl-locales/-/archive/master/musl-locales-master.zip \
&& unzip musl-locales-master.zip \
&& cd musl-locales-master \
&& cmake -DLOCALE_PROFILE=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr . && make && make install \
&& cd .. && rm -r musl-locales-master
ENV LANG ru_RU.UTF-8
ENV LANGUAGE ru_RU.UTF-8
ENV LC_ALL ru_RU.UTF-8
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]
-44
View File
@@ -1,44 +0,0 @@
# Build a project
FROM mcr.microsoft.com/dotnet/sdk:6.0.101-alpine3.14-arm64v8 AS build
WORKDIR /source
# Copy project and perform restoring
COPY Kruzya.TelegramBot.sln ./
COPY ./Core/*.csproj ./Core/
COPY ./tests/*.csproj ./tests/
COPY ./modules/CombotAntiSpam/*.csproj ./modules/CombotAntiSpam/
COPY ./modules/Destiny2.WhereIsXur/*.csproj ./modules/Destiny2.WhereIsXur/
COPY ./modules/RichSiteSummary/*.csproj ./modules/RichSiteSummary/
COPY ./modules/UrlLimitations/*.csproj ./modules/UrlLimitations/
COPY ./modules/ChatManagement/*.csproj ./modules/ChatManagement/
COPY ./modules/Entertainment/*.csproj ./modules/Entertainment/
COPY ./modules/UserGroupTag/*.csproj ./modules/UserGroupTag/
RUN dotnet restore Kruzya.TelegramBot.sln
# Copy all project files
COPY . .
RUN dotnet publish -c release -o /app --no-restore Kruzya.TelegramBot.sln && \
mkdir /app/modules && \
cp /app/TelegramBot.*.dll /app/modules/ && \
rm -f /app/TelegramBot.*.dll /app/TelegramBot.*.pdb
# Now reuse image with only runtime
FROM mcr.microsoft.com/dotnet/aspnet:6.0.101-alpine3.14-arm64v8
WORKDIR /user
COPY --from=build /app /app
ENV MUSL_LOCPATH /usr/share/i18n/locales/musl
ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN apk add --no-cache cmake make musl-dev gcc gettext-dev libintl icu-libs \
&& wget https://gitlab.com/rilian-la-te/musl-locales/-/archive/master/musl-locales-master.zip \
&& unzip musl-locales-master.zip \
&& cd musl-locales-master \
&& cmake -DLOCALE_PROFILE=OFF -D CMAKE_INSTALL_PREFIX:PATH=/usr . && make && make install \
&& cd .. && rm -r musl-locales-master
ENV LANG ru_RU.UTF-8
ENV LANGUAGE ru_RU.UTF-8
ENV LC_ALL ru_RU.UTF-8
ENTRYPOINT ["dotnet", "/app/TelegramBot.dll"]