Prepare Coolify deployment with persistent uploads
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
.git
|
||||
.gitignore
|
||||
.vs
|
||||
**/bin
|
||||
**/obj
|
||||
**/TestResults
|
||||
**/Uploads
|
||||
*.user
|
||||
*.suo
|
||||
*.log
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY WeShare/WeShare.csproj WeShare/
|
||||
RUN dotnet restore WeShare/WeShare.csproj \
|
||||
--source https://api.nuget.org/v3/index.json
|
||||
|
||||
COPY WeShare/ WeShare/
|
||||
RUN dotnet publish WeShare/WeShare.csproj \
|
||||
--configuration Release \
|
||||
--output /app/publish \
|
||||
--no-restore
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
|
||||
WORKDIR /app
|
||||
|
||||
ENV ASPNETCORE_URLS=http://+:8080 \
|
||||
ASPNETCORE_FORWARDEDHEADERS_ENABLED=true \
|
||||
WeShare__UploadRootFolder=/data/uploads
|
||||
|
||||
RUN mkdir -p /data/uploads \
|
||||
&& chown -R app:app /data/uploads /app
|
||||
|
||||
COPY --from=build --chown=app:app /app/publish .
|
||||
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD wget --quiet --spider http://127.0.0.1:8080/ || exit 1
|
||||
|
||||
ENTRYPOINT ["dotnet", "WeShare.dll"]
|
||||
Reference in New Issue
Block a user