-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (25 loc) · 773 Bytes
/
Dockerfile
File metadata and controls
36 lines (25 loc) · 773 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
28
29
30
31
32
33
34
35
36
# ========================
# Step 1: Build stage
# ========================
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy csproj and restore dependencies (allows layer caching)
COPY ./*.csproj ./
RUN dotnet restore
# Copy everything else
COPY . ./
# Publish to /src/out
RUN dotnet publish -c Release -o /src/out
# ========================
# Step 2: Runtime stage
# ========================
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
# Create uploads directory with proper permissions
RUN mkdir -p /app/uploads && chmod 755 /app/uploads
# Copy output from build stage
COPY --from=build /src/out ./
# Use 8080 to match your Dockerfile
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "EgyptOnline.dll"]