6f20721e9e
- Dockerfile & docker-compose: EXPOSE/ports updated to 4310 - nginx.conf: new server blocks for abzarasadi.ir + www (SSL at /etc/ssl/abzarasadi/, proxies to 171.22.25.73:4310) - Also fixed broken www.soroushasadi.com markdown links in nginx.conf Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
1.3 KiB
Docker
36 lines
1.3 KiB
Docker
# ── Stage 1: Build ──────────────────────────────────────────────────────────
|
|
ARG DOTNET_SDK_IMAGE=mcr.microsoft.com/dotnet/sdk:10.0
|
|
FROM ${DOTNET_SDK_IMAGE} AS build
|
|
WORKDIR /src
|
|
|
|
# NuGet through Nexus mirror
|
|
COPY nuget.docker.config /tmp/nuget.config
|
|
|
|
# Restore (layer-cached unless .csproj changes)
|
|
COPY AsadiTools.csproj .
|
|
RUN dotnet restore --configfile /tmp/nuget.config
|
|
|
|
# Copy everything else and publish
|
|
COPY . .
|
|
RUN dotnet publish -c Release -o /app/publish --no-restore
|
|
|
|
# ── Stage 2: Runtime ─────────────────────────────────────────────────────────
|
|
ARG DOTNET_RUNTIME_IMAGE=mcr.microsoft.com/dotnet/aspnet:10.0
|
|
FROM ${DOTNET_RUNTIME_IMAGE} AS runtime
|
|
WORKDIR /app
|
|
|
|
# Create data directory for SQLite volume mount
|
|
RUN mkdir -p /app/data && chmod 777 /app/data
|
|
|
|
# Copy published output
|
|
COPY --from=build /app/publish .
|
|
|
|
# Override connection string to use /app/data/asadi.db (volume path)
|
|
ENV ConnectionStrings__Default="Data Source=/app/data/asadi.db"
|
|
ENV ASPNETCORE_URLS="http://+:4310"
|
|
ENV ASPNETCORE_ENVIRONMENT="Production"
|
|
|
|
EXPOSE 4310
|
|
|
|
ENTRYPOINT ["dotnet", "AsadiTools.dll"]
|