From 94af75625b62b184fd041b306e84518076d6e05a Mon Sep 17 00:00:00 2001
From: henridb <henridb@stud.ntnu.no>
Date: Thu, 2 May 2024 19:37:12 +0200
Subject: [PATCH] fix: docker cmd

---
 Dockerfile     |  5 +++--
 web/nginx.conf | 17 +++++++++++------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 4cec825..e44e704 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -10,5 +10,6 @@ RUN npm run build
 FROM nginx:stable-alpine as production-stage
 COPY --from=build-stage /app/dist /usr/share/nginx/html
 COPY web/nginx.conf /etc/nginx/nginx.conf
-EXPOSE 80
-CMD ["npm", "run"]
\ No newline at end of file
+RUN npm run build
+
+CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
diff --git a/web/nginx.conf b/web/nginx.conf
index 60d2005..0a69719 100644
--- a/web/nginx.conf
+++ b/web/nginx.conf
@@ -1,9 +1,14 @@
-server {
-    listen 80;
-    server_name localhost;
+events {
 
-    location / {
-        root /usr/share/nginx/html;
-        try_files $uri $uri/ /index.html;
+}
+http {
+    server {
+        listen 5173;
+        server_name localhost;
+
+        location / {
+            root /usr/share/nginx/html;
+            try_files $uri $uri/ /index.html;
+        }
     }
 }
\ No newline at end of file
-- 
GitLab