Skip to content

Commit

Permalink
Merge pull request #5 from paxanga/master
Browse files Browse the repository at this point in the history
(feat) Add Dockerfile for run bot in local
  • Loading branch information
PizzaConsole authored Mar 15, 2024
2 parents 605bf02 + a79e309 commit 85cfb7f
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 !!!

0 comments on commit 85cfb7f

Please sign in to comment.