-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Radoslav Radev
committed
Apr 4, 2024
1 parent
29f9285
commit 3815357
Showing
7 changed files
with
213 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM ubuntu:latest AS base | ||
|
||
# Install NFS client utilities | ||
RUN apt-get update && \ | ||
apt-get install -y nfs-common && \ | ||
apt-get clean | ||
|
||
USER $APP_UID | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
RUN mkdir -p /app/data | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Upload/Upload.csproj", "Upload/"] | ||
RUN dotnet restore "Upload/Upload.csproj" | ||
COPY . . | ||
WORKDIR "/src/Upload" | ||
RUN dotnet build "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
ENV CONSUL_IP=consul-service | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
COPY Upload/entrypoint.sh /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh | ||
USER $APP_UID | ||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM ubuntu:latest AS base | ||
|
||
# Install NFS client utilities | ||
RUN apt-get update && \ | ||
apt-get install -y nfs-common && \ | ||
apt-get clean | ||
|
||
USER $APP_UID | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
RUN mkdir -p /app/data | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Upload/Upload.csproj", "Upload/"] | ||
RUN dotnet restore "Upload/Upload.csproj" | ||
COPY . . | ||
WORKDIR "/src/Upload" | ||
RUN dotnet build "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
ENV CONSUL_IP=consul-service | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
COPY Upload/entrypoint.sh /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh | ||
USER $APP_UID | ||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM ubuntu:latest AS base | ||
|
||
# Install NFS client utilities | ||
RUN apt-get update && \ | ||
apt-get install -y nfs-common && \ | ||
apt-get clean | ||
|
||
USER $APP_UID | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
RUN mkdir -p /app/data | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Upload/Upload.csproj", "Upload/"] | ||
RUN dotnet restore "Upload/Upload.csproj" | ||
COPY . . | ||
WORKDIR "/src/Upload" | ||
RUN dotnet build "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
ENV CONSUL_IP=consul-service | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
COPY Upload/entrypoint.sh /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh | ||
USER $APP_UID | ||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM ubuntu:latest AS base | ||
|
||
# Install NFS client utilities | ||
RUN apt-get update && \ | ||
apt-get install -y nfs-common && \ | ||
apt-get clean | ||
|
||
USER $APP_UID | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
RUN mkdir -p /app/data | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Upload/Upload.csproj", "Upload/"] | ||
RUN dotnet restore "Upload/Upload.csproj" | ||
COPY . . | ||
WORKDIR "/src/Upload" | ||
RUN dotnet build "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
|
||
FROM base AS final | ||
ENV CONSUL_IP=consul-service | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
COPY Upload/entrypoint.sh /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh | ||
USER $APP_UID | ||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,44 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
# Install FFmpeg | ||
# Use Ubuntu as the base for the custom .NET environment | ||
FROM ubuntu:20.04 AS base | ||
|
||
# Install .NET dependencies, NFS support, and other essential tools | ||
RUN apt-get update && apt-get install -y \ | ||
software-properties-common \ | ||
nfs-common \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Microsoft package signing key and repository | ||
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ | ||
&& dpkg -i packages-microsoft-prod.deb \ | ||
&& rm packages-microsoft-prod.deb | ||
|
||
# Install .NET SDK and Runtime | ||
RUN apt-get update && \ | ||
apt-get install -y ffmpeg && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
apt-get install -y apt-transport-https && \ | ||
apt-get update && \ | ||
apt-get install -y dotnet-sdk-8.0 dotnet-runtime-8.0 | ||
|
||
ENV APP_UID=1000 | ||
|
||
USER $APP_UID | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
RUN mkdir -p /app/data | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Render/Render.csproj", "Render/"] | ||
RUN dotnet restore "Render/Render.csproj" | ||
COPY . . | ||
WORKDIR "/src/Render" | ||
RUN dotnet build "Render.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
RUN mkdir -p /app/data | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Render.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
# Copy the rest of your application's code and follow the same build steps as before | ||
COPY . /app | ||
|
||
FROM base AS final | ||
ENV CONSUL_IP=consul-service | ||
# Assuming you have a similar structure for the build and publish stages, | ||
# you can follow the same approach as in your original Dockerfile. | ||
# Remember to adjust paths and commands as needed for your application. | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
COPY Render/entrypoint.sh /entrypoint.sh | ||
# Final setup | ||
COPY Upload/entrypoint.sh /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh && chown $APP_UID /app/data | ||
USER $APP_UID | ||
|
||
|
||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | ||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,44 @@ | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
# Use Ubuntu as the base for the custom .NET environment | ||
FROM ubuntu:20.04 AS base | ||
|
||
# Install .NET dependencies, NFS support, and other essential tools | ||
RUN apt-get update && apt-get install -y \ | ||
software-properties-common \ | ||
nfs-common \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install Microsoft package signing key and repository | ||
RUN wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb \ | ||
&& dpkg -i packages-microsoft-prod.deb \ | ||
&& rm packages-microsoft-prod.deb | ||
|
||
# Install .NET SDK and Runtime | ||
RUN apt-get update && \ | ||
apt-get install -y apt-transport-https && \ | ||
apt-get update && \ | ||
apt-get install -y dotnet-sdk-8.0 dotnet-runtime-8.0 | ||
|
||
ENV APP_UID=1000 | ||
|
||
USER $APP_UID | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 8080 | ||
EXPOSE 8081 | ||
RUN mkdir -p /app/data | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["Upload/Upload.csproj", "Upload/"] | ||
RUN dotnet restore "Upload/Upload.csproj" | ||
COPY . . | ||
WORKDIR "/src/Upload" | ||
RUN dotnet build "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
RUN mkdir -p /app/data | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "Upload.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
# Copy the rest of your application's code and follow the same build steps as before | ||
COPY . /app | ||
|
||
FROM base AS final | ||
ENV CONSUL_IP=consul-service | ||
# Assuming you have a similar structure for the build and publish stages, | ||
# you can follow the same approach as in your original Dockerfile. | ||
# Remember to adjust paths and commands as needed for your application. | ||
|
||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
# Final setup | ||
COPY Upload/entrypoint.sh /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh | ||
USER root | ||
RUN chmod +x /entrypoint.sh && chown $APP_UID /app/data | ||
USER $APP_UID | ||
ENTRYPOINT ["/bin/sh", "/entrypoint.sh"] | ||
|
||
|