-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
32 lines (25 loc) · 1001 Bytes
/
Dockerfile.dev
File metadata and controls
32 lines (25 loc) · 1001 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
# ============================
# DEVELOPMENT STAGE
# ============================
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS dev
WORKDIR /app
# Ensure NuGet packages folder exists
ENV NUGET_PACKAGES=/root/.nuget/packages
RUN mkdir -p /root/.nuget/packages
# Copy csproj files first to restore dependencies (cache layer)
COPY Api/Api.csproj Api/
COPY Application/Application.csproj Application/
COPY Domain/Domain.csproj Domain/
COPY Persistence/Persistence.csproj Persistence/
# Restore NuGet packages to avoid Windows fallback paths
RUN dotnet restore Api/Api.csproj --packages /root/.nuget/packages
# Install dotnet-ef globally so migrations can run inside the container
RUN dotnet tool install --global dotnet-ef --version 10.0.0
ENV PATH="$PATH:/root/.dotnet/tools"
# Copy all source code
COPY . .
# Expose ports for development
EXPOSE 5000
EXPOSE 5001
# Start the backend with hot reload
CMD ["dotnet", "watch", "run", "--project", "Api/Api.csproj", "--urls", "http://0.0.0.0:5000"]