switching to nginx
This commit is contained in:
parent
9c8186ca45
commit
99158cd422
@ -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;"]
|
||||
|
18
httpd.conf
18
httpd.conf
@ -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
20
nginx.conf
Normal 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;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user