Create Apache config and Dockerfile

This commit is contained in:
Maciej Pędzich 2024-07-26 16:36:36 +02:00
parent d7c966c37f
commit 4c56bb2b75
Signed by: maciejpedzich
GPG Key ID: CE4A303D84882F0D
3 changed files with 22 additions and 12 deletions

10
Dockerfile Normal file
View File

@ -0,0 +1,10 @@
FROM node:lts-alpine AS build
WORKDIR /app
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/
EXPOSE 80

12
httpd.conf Normal file
View File

@ -0,0 +1,12 @@
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>

View File

@ -1,12 +0,0 @@
# example netlify.toml
[build]
command = "vite build"
functions = "netlify/functions"
publish = "dist"
## Uncomment to use this redirect for Single Page Applications
## Not needed for static site generators.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200