Skip to content

Commit

Permalink
added dockerfile for render.com deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenormanlang committed Oct 3, 2024
1 parent 54be1b9 commit 25e8295
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 1,143 deletions.
26 changes: 26 additions & 0 deletions InventoryManagementSystem/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use the official .NET SDK image for building the application (targeting .NET 8)
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env
WORKDIR /app

# Copy the project file and restore any dependencies (via NuGet)
COPY *.csproj ./
RUN dotnet restore

# Copy the entire source code and build the project
COPY . ./
RUN dotnet publish -c Release -o out

# Use the official .NET runtime image for running the app (targeting .NET 8)
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build-env /app/out .

# Set environment variables
ENV ASPNETCORE_URLS=http://+:5000
ENV ASPNETCORE_ENVIRONMENT=Production

# Expose the API port
EXPOSE 5000

# Run the app
ENTRYPOINT ["dotnet", "InventoryManagementSystem.dll"]
4 changes: 4 additions & 0 deletions InventoryManagementSystem/InventoryManagementSystem.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,8 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
</ItemGroup>

<ItemGroup>
<Folder Include="Migrations\" />
</ItemGroup>

</Project>

This file was deleted.

This file was deleted.

100 changes: 0 additions & 100 deletions InventoryManagementSystem/Migrations/20240906183020_model_change.cs

This file was deleted.

Loading

0 comments on commit 25e8295

Please sign in to comment.