docasaurus Dockerfile fix
This commit is contained in:
parent
7a9a338062
commit
ba638c41b1
|
@ -0,0 +1,19 @@
|
||||||
|
# stage1 as builder
|
||||||
|
FROM node:20-alpine AS builder
|
||||||
|
|
||||||
|
# copy the package.json to install dependencies
|
||||||
|
COPY package.json ./
|
||||||
|
|
||||||
|
# Install the dependencies and make the folder
|
||||||
|
RUN npm install --legacy-peer-deps && mkdir /src && mv ./node_modules ./src
|
||||||
|
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
# Build the project and copy the files
|
||||||
|
RUN npm run build
|
||||||
|
#RUN node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build -- --deploy-url=/ --prod
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
## Run the production server.
|
||||||
|
CMD ["npm", "run", "serve", "--", "--host", "0.0.0.0", "--no-open"]
|
|
@ -1,35 +0,0 @@
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 4096; ## Default: 1024
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
include ./mime.types;
|
|
||||||
server {
|
|
||||||
|
|
||||||
listen 4200;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_http_version 1.1;
|
|
||||||
gzip_disable "MSIE [1-6]\.";
|
|
||||||
gzip_min_length 1100;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
|
||||||
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
|
||||||
gzip_comp_level 9;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
location / {
|
|
||||||
root /usr/share/nginx/html;
|
|
||||||
try_files $uri $uri/ /index.html =404;
|
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
if [[ ! -z "${WEBAPP_BASE_URL}" ]]; then
|
|
||||||
rm /usr/share/nginx/html/index.html
|
|
||||||
cp /usr/share/nginx/html/index_base.html /usr/share/nginx/html/index.html
|
|
||||||
find '/usr/share/nginx/html' -name 'index.html' -exec sed -i -e 's,<base href="/">,<base href="'"$WEBAPP_BASE_URL"'">,g' {} \;
|
|
||||||
fi
|
|
||||||
|
|
||||||
nginx -g "daemon off;"
|
|
Loading…
Reference in New Issue