Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorbobaylor committed Mar 31, 2024
1 parent 8344666 commit 27ec26c
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
# Use the latest ASP.NET Core runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 80
EXPOSE 443

# Use the latest .NET SDK for building the application
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build

# Install Node.js
# Note: Consider using a specific version of Node.js for better stability and compatibility
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y \
nodejs \
&& rm -rf /var/lib/apt/lists/*

# Set the working directory
ARG BUILD_CONFIGURATION=Release
WORKDIR /src

# Copy the project file and restore dependencies
Expand All @@ -28,11 +19,12 @@ COPY . .
WORKDIR "/src/TrailerDownloader"

# Build the project
RUN dotnet build "TrailerDownloader.csproj" -c Release -o /app/build
RUN dotnet build "TrailerDownloader.csproj" -c $BUILD_CONFIGURATION -o /app/build

# Publish the project
FROM build AS publish
RUN dotnet publish "TrailerDownloader.csproj" -c Release -o /app/publish --no-restore --no-build
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "TrailerDownloader.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

# Final stage
FROM base AS final
Expand Down

0 comments on commit 27ec26c

Please sign in to comment.