From f846efc226544433d8b5365f0c6eabab077d3f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Fri, 26 Jul 2024 16:53:59 +0200 Subject: [PATCH] Replace Apache with Nginx --- Dockerfile | 7 ++++--- httpd.conf | 18 ------------------ nginx/default.conf | 9 +++++++++ 3 files changed, 13 insertions(+), 21 deletions(-) delete mode 100644 httpd.conf create mode 100644 nginx/default.conf diff --git a/Dockerfile b/Dockerfile index 69f080f..0b018ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ COPY . . RUN npm i RUN npm run build -FROM httpd:2.4-alpine AS runtime -COPY --from=build /app/httpd.conf /usr/local/apache2/conf/httpd.conf -COPY --from=build /app/dist /usr/local/apache2/htdocs/ +FROM nginx:stable-alpine AS runtime +COPY --from=build /app/nginx/default.conf /etc/nginx/conf.d/default.conf +COPY --from=build /app/dist /usr/share/nginx/html EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/httpd.conf b/httpd.conf deleted file mode 100644 index b2e895c..0000000 --- a/httpd.conf +++ /dev/null @@ -1,18 +0,0 @@ -ServerName racemash.maciejpedzi.ch - -LoadModule mpm_event_module modules/mod_mpm_event.so -#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so -#LoadModule mpm_worker_module modules/mod_mpm_worker.so - - - Options -MultiViews - - - - RewriteEngine On - RewriteBase / - RewriteRule ^index\.html$ - [L] - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule . /index.html [L] - diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..8d0cf78 --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,9 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html index.htm; + location / { + try_files $uri $uri/ /index.html; + } +}