feat: 支持docker

This commit is contained in:
橙子
2025-02-09 22:23:23 +08:00
parent c0dfa83828
commit ed873da3b6
6 changed files with 100 additions and 4 deletions

33
Yi.Bbs.Vue3/.dockerignore Normal file
View File

@@ -0,0 +1,33 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
appsettings.Development.json
appsettings.Production.json
appsettings.Staging.json

View File

@@ -1,5 +1,4 @@
FROM nginx as base
COPY nginx.conf /etc/nginx/nginx.conf
FROM nginx:stable-alpine3.20-perl as base
EXPOSE 18001
FROM node:20.18 as publish
@@ -10,5 +9,5 @@ RUN npm run build
FROM base AS final
WORKDIR /app
COPY --from=publish /dist/* .
COPY --from=publish /main/dist/ .
ENTRYPOINT ["nginx", "-g", "daemon off;"]

28
Yi.Bbs.Vue3/yi-bbs.conf Normal file
View File

@@ -0,0 +1,28 @@
server {
client_header_buffer_size 10k;
large_client_header_buffers 40 40k;
listen 18001;
server_name _;
client_max_body_size 100m;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
location /{
root /app;
index index.html;
try_files $uri $uri/ /index.html;
}
location /prod-api/ {
proxy_pass http://ccnetcore.com:19001/api/app/;
}
location /prod-ws/ {
proxy_pass http://ccnetcore.com:19001/hub/;
}
}