-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
113b587
commit fc73327
Showing
5 changed files
with
1,415 additions
and
906 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,31 @@ | ||
ARG NODE_VERSION=22.2.0 | ||
ARG NODE_VERSION=22.11.0 | ||
ARG NPM_REGISTER=https://registry.npmjs.org | ||
ARG BASE_URL=/vuepress-solid-template/ | ||
|
||
# Builder | ||
FROM node:$NODE_VERSION-bookworm AS builder | ||
WORKDIR /app | ||
FROM node:${NODE_VERSION}-bookworm AS builder | ||
ARG NPM_REGISTER | ||
COPY . ./ | ||
WORKDIR /app | ||
ENV NODE_OPTIONS=--max-old-space-size=4096 | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
RUN npm -v \ | ||
&& npm config set registry $NPM_REGISTER \ | ||
&& npm install -g pnpm \ | ||
&& pnpm -v \ | ||
&& pnpm config set registry $NPM_REGISTER \ | ||
&& pnpm install \ | ||
&& pnpm build | ||
&& pnpm install | ||
|
||
COPY . ./ | ||
|
||
RUN pnpm build | ||
|
||
# Nginx Server | ||
FROM nginx:1.25.5-alpine3.19-slim | ||
WORKDIR /usr/share/nginx/html/ | ||
COPY --from=builder /app/docs/.vuepress/dist/ ./ | ||
RUN echo "<script>window.location.href = '/vuepress-solid-template/'</script>" > /usr/share/nginx/html/index.html | ||
EXPOSE 80 | ||
FROM nginx:1.27.3-alpine3.20-slim | ||
ARG BASE_URL | ||
WORKDIR /usr/share/nginx/html${BASE_URL} | ||
COPY --from=builder /app/docs/.vuepress/dist ./ | ||
COPY ./docker/nginx.conf /etc/nginx/conf.d/default.conf | ||
EXPOSE 8080 | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
server { | ||
listen 8080 default_server; | ||
server_name _; | ||
absolute_redirect off; | ||
|
||
location / { | ||
rewrite ^/$ /vuepress-solid-template/ permanent; | ||
} | ||
|
||
location /vuepress-solid-template/ { | ||
root /usr/share/nginx/html; | ||
try_files $uri $uri/ @router; | ||
index index.html; | ||
} | ||
|
||
location @router { | ||
rewrite ^.*$ /index.html last; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.