switching to nginx

This commit is contained in:
Ubuntu 2025-04-14 14:16:06 +02:00
parent 9c8186ca45
commit 99158cd422
3 changed files with 24 additions and 22 deletions

View File

@ -5,11 +5,11 @@ COPY . .
RUN npm install RUN npm install
RUN npx vite build RUN npx vite build
FROM httpd:2.4 FROM nginx:latest
COPY --from=builder /app/build/ /usr/local/apache2/htdocs/ COPY --from=builder /app/build /usr/share/nginx/html
COPY httpd.conf /usr/local/apache2/conf/httpd.conf COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 3000 EXPOSE 3000
CMD ["httpd-foreground"]
CMD ["nginx", "-g", "daemon off;"]

View File

@ -1,18 +0,0 @@
ServerRoot "/usr/local/apache2"
Listen 3000
LoadModule rewrite_module modules/mod_rewrite.so
DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/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]
</Directory>

20
nginx.conf Normal file
View File

@ -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;
}
}