-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 769 Bytes
/
Dockerfile
File metadata and controls
27 lines (20 loc) · 769 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Base image for build
FROM mcr.microsoft.com/dotnet/sdk:10.0-preview AS build
WORKDIR /src
# Copy the project file and restore dependencies
COPY ["sbb-bot/sbb-bot.csproj", "sbb-bot/"]
RUN dotnet restore "sbb-bot/sbb-bot.csproj"
# Copy the rest of the source code
COPY . .
# Publish the application
WORKDIR "/src/sbb-bot"
RUN dotnet publish -c Release -o /app/publish
# Runtime image
FROM mcr.microsoft.com/dotnet/runtime:10.0-preview
WORKDIR /app
COPY --from=build /app/publish .
ENV DATABASE_URL=""
# Data directory for JSON storage
# Note: In Railway (without volumes), this data is ephemeral and resets on deploy/restart.
# The application handles "First Run" scenarios gracefully, so this is acceptable for basic usage.
ENTRYPOINT ["dotnet", "sbb-bot.dll"]