diff --git a/Dockerfile b/Dockerfile index dfc7f4a..acb34e4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,11 @@ COPY . . RUN npm install RUN npx vite build -FROM httpd:2.4 +FROM nginx:latest -COPY --from=builder /app/build/ /usr/local/apache2/htdocs/ -COPY httpd.conf /usr/local/apache2/conf/httpd.conf +COPY --from=builder /app/build /usr/share/nginx/html +COPY nginx.conf /etc/nginx/nginx.conf EXPOSE 3000 -CMD ["httpd-foreground"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/httpd.conf b/httpd.conf deleted file mode 100644 index aea508f..0000000 --- a/httpd.conf +++ /dev/null @@ -1,18 +0,0 @@ -ServerRoot "/usr/local/apache2" -Listen 3000 - -LoadModule rewrite_module modules/mod_rewrite.so - -DocumentRoot "/usr/local/apache2/htdocs" - - AllowOverride All - Require all granted - - RewriteEngine On - - RewriteRule ^/$ /index.html [L] - - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^.*$ /404.html [L] - diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..f25b4a9 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,20 @@ +worker_processes auto; + +events { + worker_connections 1024; +} + +http { + include /etc/nginx/mime.types; + sendfile on; + + server { + listen 3000; + server_name localhost; + + root /usr/share/nginx/html; + index index.html; + + error_page 404 /404.html; + } +}