From cfd44242f4396b1702496bb0d9c656b3ede4b4c8 Mon Sep 17 00:00:00 2001
From: cubic <cubicgraphics98@gmail.com>
Date: Tue, 14 May 2024 01:13:43 +0100
Subject: [PATCH] Fix dockerfile

---
 .dockerignore |  4 ++++
 Dockerfile    | 15 +++++++++++++++
 2 files changed, 19 insertions(+)
 create mode 100644 .dockerignore
 create mode 100644 Dockerfile

diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..f1ec82a
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,4 @@
+.*
+run
+out
+Dockerfile
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..028451e
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,15 @@
+FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build-env
+WORKDIR /app
+
+# Restore the project
+COPY . ./
+RUN dotnet restore
+
+# Build the project
+RUN dotnet publish -c Release -p:PublishReadyToRun=true -r linux-x64 -o out
+
+# Run the application
+FROM mcr.microsoft.com/dotnet/runtime:7.0
+WORKDIR /app
+COPY --from=build-env /app/out .
+ENTRYPOINT ["dotnet", "/app/BeatTogether.Status.Api.dll"]