feat(project): init
This commit is contained in:
70
docker/nginx.conf
Normal file
70
docker/nginx.conf
Normal file
@@ -0,0 +1,70 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
gzip_min_length 10240;
|
||||
gzip_comp_level 6;
|
||||
|
||||
server {
|
||||
listen 5521;
|
||||
server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
# add_header Cache-Control no-cache;
|
||||
# add_header Access-Control-Allow-Origin *;
|
||||
# add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
|
||||
# add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
|
||||
# 将以.html结尾的请求添加Cache-Control头信息
|
||||
if ($uri ~* \.(html)$) {
|
||||
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
|
||||
}
|
||||
|
||||
root /usr/share/nginx/html/out;
|
||||
|
||||
index index.html index.htm *.html;
|
||||
|
||||
# try_files $uri $uri/ /index.html;
|
||||
# 默认情况下,根据路径转发,找不到加载index.html
|
||||
try_files $uri /$uri.html /index.html;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
|
||||
# include /etc/nginx/conf.d/*.conf;
|
||||
}
|
||||
8
docker/nginx.dockerfile
Normal file
8
docker/nginx.dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM harbor.cowarobot.cn/nginx/nginx:stable
|
||||
|
||||
ADD ./out /usr/share/nginx/html/out
|
||||
ADD ./docker/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
RUN chmod -R 777 /usr/share/nginx/html
|
||||
|
||||
ENV PORT 5521
|
||||
16
docker/node.dockerfile
Normal file
16
docker/node.dockerfile
Normal file
@@ -0,0 +1,16 @@
|
||||
# build first
|
||||
FROM harbor.cowarobot.cn/docker.io/node:20-alpine
|
||||
RUN mkdir -p /app
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV production
|
||||
COPY ./.next/standalone ./standalone
|
||||
COPY ./public /app/standalone/public
|
||||
COPY ./.next/static /app/standalone/.next/static
|
||||
|
||||
ENV PORT 5521
|
||||
|
||||
ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
EXPOSE 5521
|
||||
|
||||
CMD ["node", "./standalone/server.js"]
|
||||
Reference in New Issue
Block a user