38 lines
776 B
Docker
38 lines
776 B
Docker
FROM mcr.microsoft.com/dotnet/sdk:7.0-alpine AS build
|
|
|
|
WORKDIR /source
|
|
|
|
COPY Pacmeow.sln ./
|
|
|
|
COPY src/Nyanbyte.Pacmeow.Server/*.csproj ./src/Nyanbyte.Pacmeow.Server/
|
|
|
|
RUN dotnet restore
|
|
|
|
COPY src/Nyanbyte.Pacmeow.Server/. ./src/Nyanbyte.Pacmeow.Server/
|
|
|
|
RUN dotnet publish ./src/Nyanbyte.Pacmeow.Server/Nyanbyte.Pacmeow.Server.csproj -c Release -o /build/pacmeow
|
|
|
|
FROM mcr.microsoft.com/dotnet/aspnet:7.0-alpine AS runtime
|
|
|
|
# Environment vars
|
|
|
|
RUN mkdir -p /srv/certs /srv/log
|
|
|
|
# Files
|
|
|
|
COPY --from=build /build/pacmeow /srv/pacmeow
|
|
|
|
VOLUME [ "/srv/pacmeow", "/srv/certs", "/srv/log", "/var/cache/pacmeow" ]
|
|
|
|
WORKDIR /srv/pacmeow
|
|
|
|
# Net
|
|
|
|
EXPOSE 80/tcp
|
|
EXPOSE 443/tcp
|
|
|
|
# Process handling
|
|
|
|
STOPSIGNAL SIGTERM
|
|
|
|
ENTRYPOINT [ "dotnet", "/srv/pacmeow/Nyanbyte.Pacmeow.Server.dll" ]
|