Configured for docker container

This commit is contained in:
Fishandchips321 2026-02-23 14:58:42 +00:00
parent 226caf4c1e
commit 8e92077490
7 changed files with 51 additions and 4 deletions

View file

@ -0,0 +1,28 @@
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS dotnet_build
WORKDIR /App
COPY ./backend/src ./
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM node:25.6.1-bookworm AS react_build
WORKDIR /App
COPY ./frontend ./
RUN npm ci
RUN npm run build
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /App
EXPOSE 5000
EXPOSE 5001
COPY --from=dotnet_build /App/out .
COPY --from=react_build /App/dist ./wwwroot
ENV ASPNETCORE_URLS=http://+:5000
ENTRYPOINT ["dotnet", "JellyGlass-Backend.dll"]

View file

@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
namespace JellyGlass.Controllers;
[ApiController]
[Route("[controller]")]
[Route("api/[controller]")]
public class SearchController : ControllerBase
{
private ILogger<SearchController> _logger;

View file

@ -4,7 +4,7 @@ using Microsoft.AspNetCore.Mvc;
namespace JellyGlass.Controllers;
[ApiController]
[Route("[controller]")]
[Route("api/[controller]")]
public class ServersController : ControllerBase
{
private ILogger<ServersController> _logger;

Binary file not shown.

View file

@ -1,5 +1,6 @@
using JellyGlass.Repositories;
using JellyGlass.Services;
using Microsoft.EntityFrameworkCore;
var builder = WebApplication.CreateBuilder(args);
@ -18,7 +19,7 @@ if (builder.Environment.IsDevelopment())
}
else
{
dbConnectionString = "Data Source./JellyGlass.db;";
dbConnectionString = "Data Source=JellyGlass.db;";
}
builder.Services.AddSqlite<DatabaseContext>(dbConnectionString);
@ -31,6 +32,22 @@ builder.Services.AddTransient<ISearchService, SearchService>();
var app = builder.Build();
using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
dbContext.Database.Migrate();
dbContext.Servers.Add(new JellyGlass.Models.Server()
{
ApiToken = "56b6f91b816540b59d03a0db53c2dc8e",
Id = "1",
Owner = "Riley",
Url = "https://jellyfin.foxhawk.co.uk"
});
dbContext.SaveChanges();
}
// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
@ -39,5 +56,7 @@ if (app.Environment.IsDevelopment())
app.UseHttpsRedirection();
app.MapControllers();
app.UseDefaultFiles();
app.UseStaticFiles();
app.Run();

View file

@ -1,2 +1,2 @@
export const apiUrl = "http://localhost:5092"
export const apiUrl = "http://localhost:5000/api"