feat: 添加nginx配置
parent
6c196f9efb
commit
09a0295c6f
|
|
@ -0,0 +1,15 @@
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
Dockerfile
12
Dockerfile
|
|
@ -1,5 +1,15 @@
|
||||||
|
FROM node:20-alpine as build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY ./package.json .
|
||||||
|
COPY ./pnpm-lock.yaml .
|
||||||
|
RUN corepack enable
|
||||||
|
RUN pnpm install --registry https://registry.npmmirror.com/
|
||||||
|
COPY . .
|
||||||
|
RUN pnpm build
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY ./dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
COPY --from=build /app/.github/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
Loading…
Reference in New Issue