🐳 添加 docker 配置.
This commit is contained in:
10
docker/orion-ops-pro/Dockerfile
Normal file
10
docker/orion-ops-pro/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
||||
FROM nginx:alpine
|
||||
USER root
|
||||
RUN apk add openjdk8
|
||||
RUN rm -rf /etc/nginx/conf.d/*
|
||||
WORKDIR /app
|
||||
COPY orion-ops-launch/target/orion-ops-launch.jar /app/app.jar
|
||||
COPY orion-ops-ui/dist /usr/share/nginx/html
|
||||
ADD docker/orion-ops-pro/entrypoint.sh /app/entrypoint.sh
|
||||
ADD docker/orion-ops-pro/nginx.conf /etc/nginx/conf.d
|
||||
ENTRYPOINT [ "sh", "/app/entrypoint.sh" ]
|
||||
4
docker/orion-ops-pro/entrypoint.sh
Normal file
4
docker/orion-ops-pro/entrypoint.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
nginx
|
||||
cd /app
|
||||
java -jar app.jar --spring.profiles.active=prod
|
||||
53
docker/orion-ops-pro/nginx.conf
Normal file
53
docker/orion-ops-pro/nginx.conf
Normal file
@@ -0,0 +1,53 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# 是否启动 gzip 压缩
|
||||
gzip on;
|
||||
# 需要压缩的常见静态资源
|
||||
gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
|
||||
# 如果文件大于 1k 就启动压缩
|
||||
gzip_min_length 1k;
|
||||
# 缓冲区
|
||||
gzip_buffers 4 16k;
|
||||
# 压缩的等级
|
||||
gzip_comp_level 2;
|
||||
# access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /orion/api {
|
||||
proxy_pass http://localhost:9200/orion/api;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
location /orion/keep-alive {
|
||||
proxy_pass http://localhost:9200/orion/keep-alive;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 3600s;
|
||||
proxy_send_timeout 3600s;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user