From a79e309f9dc6ee0f1a2539e9320e41201c1e161a Mon Sep 17 00:00:00 2001 From: Alejandro Aranda Date: Sat, 3 Feb 2024 13:01:58 +0100 Subject: [PATCH] (feat) Add Dockerfile for tun bot in local --- Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..60eef48 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +# Use the official .NET SDK image with version 6.0 as the base image +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build + +# Set the working directory in the container +WORKDIR /var/www/poisncopy + +# Copy only the necessary files for restoring dependencies +COPY *.csproj . +RUN dotnet restore + +# Copy the entire project and build it +COPY . . +RUN dotnet build --configuration Release + +# Publish the application +RUN dotnet publish -c Release -o out + +# Use the official .NET runtime image with version 6.0 as the base image +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime + +# Set the working directory in the container +WORKDIR /var/www/poisncopy + +# Copy the published application to the container +COPY --from=build /var/www/poisncopy/out . + +# Start the application +ENTRYPOINT ["/usr/bin/dotnet", "/var/www/poisncopy/PoisnCopy.dll"] + + + + +# How to build and run the Docker image + +# 1. Build the Docker image +# docker build -t poisncopy:latest . + +# 2. Run the Docker image +# docker run poisncopy:latest + +# 3. Enjoy !!! \ No newline at end of file