fixed build, fixed dockerfile not building properly

This commit is contained in:
Toastie 2025-02-11 13:59:12 +13:00
parent d9c27021aa
commit 4f1cdde9b2
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
3 changed files with 52 additions and 53 deletions
Dockerfile
src/EllieBot/Modules/Games/Fish

View file

@ -8,9 +8,10 @@ COPY src/EllieBot/*.csproj src/EllieBot/
COPY src/EllieBot.Coordinator/*.csproj src/EllieBot.Coordinator/ COPY src/EllieBot.Coordinator/*.csproj src/EllieBot.Coordinator/
COPY src/EllieBot.Generators/*.csproj src/EllieBot.Generators/ COPY src/EllieBot.Generators/*.csproj src/EllieBot.Generators/
COPY src/EllieBot.Voice/*.csproj src/EllieBot.Voice/ COPY src/EllieBot.Voice/*.csproj src/EllieBot.Voice/
COPY src/EllieBot.GrpcApiBase/*.csproj src/EllieBot.GrpcApiBase/
# Restore the dependencies for the EllieBot project # Restore the dependencies for the EllieBot project
RUN dotnet restore src/EllieBot/ RUN dotnet restore src/EllieBot/ -r linux-x64
# Copy the rest of the source code # Copy the rest of the source code
COPY . . COPY . .
@ -19,7 +20,6 @@ COPY . .
WORKDIR /source/src/EllieBot WORKDIR /source/src/EllieBot
# Build and publish the EllieBot project, then clean up unnecessary files # Build and publish the EllieBot project, then clean up unnecessary files
RUN dotnet restore
RUN dotnet publish -c Release -o /app --self-contained -r linux-x64 --no-restore; \ RUN dotnet publish -c Release -o /app --self-contained -r linux-x64 --no-restore; \
mv /app/data /app/data_init; \ mv /app/data /app/data_init; \
chmod +x /app/EllieBot chmod +x /app/EllieBot
@ -30,10 +30,11 @@ WORKDIR /app
# Create a new user, install dependencies, and set up sudoers file # Create a new user, install dependencies, and set up sudoers file
RUN apt update; \ RUN apt update; \
apt install -y curl ffmpeg python3; \ apt install -y --no-install-recommends curl ffmpeg python3; \
curl -Lo /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp; \ curl -Lo /usr/local/bin/yt-dlp https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp; \
chmod a+rx /usr/local/bin/yt-dlp; \ chmod a+rx /usr/local/bin/yt-dlp; \
apt autoremove -y; apt autoremove -y; \
apt clean -y;
# Copy the built application and the entrypoint script from the build stage # Copy the built application and the entrypoint script from the build stage
COPY --from=build /app ./ COPY --from=build /app ./

View file

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
namespace EllieBot.Modules.Games; namespace NadekoBot.Modules.Games;
public sealed class UserFishStats public sealed class UserFishStats
{ {
@ -14,16 +14,15 @@ public sealed class UserFishStats
public int? Bait { get; set; } public int? Bait { get; set; }
} }
public sealed class FishingPole // public sealed class FishingPole
{ // {
[Key] // [Key]
public int Id { get; set; } // public int Id { get; set; }
// public string Name { get; set; } = string.Empty;
// public long Price { get; set; }
public string Name { get; set; } = string.Empty; // public string Emoji { get; set; } = string.Empty;
public long Price { get; set; } // }
public string Emoji { get; set; } = string.Empty;
}

View file

@ -13,44 +13,43 @@ public sealed partial class FishConfig : ICloneable<FishConfig>
public List<string> StarEmojis { get; set; } = new(); public List<string> StarEmojis { get; set; } = new();
public List<string> SpotEmojis { get; set; } = new(); public List<string> SpotEmojis { get; set; } = new();
public FishChance Chance { get; set; } = new FishChance(); public FishChance Chance { get; set; } = new FishChance();
// public List<FishBait> Baits { get; set; } = new();
public List<FishBait> Baits { get; set; } = new(); // public List<FishingPole> Poles { get; set; } = new();
public List<FishingPole> Poles { get; set; } = new();
public List<FishData> Fish { get; set; } = new(); public List<FishData> Fish { get; set; } = new();
public List<FishData> Trash { get; set; } = new(); public List<FishData> Trash { get; set; } = new();
} }
public sealed class FishBait : ICloneable<FishBait> // public sealed class FishBait : ICloneable<FishBait>
{ // {
public int Id { get; set; } // public int Id { get; set; }
public string Name { get; set; } = string.Empty; // public string Name { get; set; } = string.Empty;
public long Price { get; set; } // public long Price { get; set; }
public string Emoji { get; set; } = string.Empty; // public string Emoji { get; set; } = string.Empty;
public int StackSize { get; set; } = 100; // public int StackSize { get; set; } = 100;
//
public string? OnlyWeather { get; set; } // public string? OnlyWeather { get; set; }
public string? OnlySpot { get; set; } // public string? OnlySpot { get; set; }
public string? OnlyTime { get; set; } // public string? OnlyTime { get; set; }
//
public double FishMulti { get; set; } = 1; // public double FishMulti { get; set; } = 1;
public double TrashMulti { get; set; } = 1; // public double TrashMulti { get; set; } = 1;
public double NothingMulti { get; set; } = 1; // public double NothingMulti { get; set; } = 1;
//
public double RareFishMulti { get; set; } = 1; // public double RareFishMulti { get; set; } = 1;
public double RareTrashMulti { get; set; } = 1; // public double RareTrashMulti { get; set; } = 1;
//
public double MaxStarMulti { get; set; } = 1; // public double MaxStarMulti { get; set; } = 1;
} // }
//
public sealed class FishingPole : ICloneable<FishingPole> // public sealed class FishingPole : ICloneable<FishingPole>
{ // {
public int Id { get; set; } // public int Id { get; set; }
public string Name { get; set; } = string.Empty; // public string Name { get; set; } = string.Empty;
public long Price { get; set; } // public long Price { get; set; }
public string Emoji { get; set; } = string.Empty; // public string Emoji { get; set; } = string.Empty;
public string Img { get; set; } = string.Empty; // public string Img { get; set; } = string.Empty;
//
public double FishMulti { get; set; } = 1; // public double FishMulti { get; set; } = 1;
public double TrashMulti { get; set; } = 1; // public double TrashMulti { get; set; } = 1;
public double NothingMulti { get; set; } = 1; // public double NothingMulti { get; set; } = 1;
} // }