Skip to content

Commit bc7c72f

Browse files
committed
perf: merge with osm
2 parents a6d62b2 + 3db2c56 commit bc7c72f

15 files changed

Lines changed: 74 additions & 100 deletions

.github/workflows/build-static-image.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ name: Build and Push Base Image
33
on:
44
push:
55
branches:
6-
- 'pr*'
6+
- "pr*"
7+
- "osm"
78
paths:
8-
- 'versions.txt'
9-
- 'prepare.sh'
10-
- 'Dockerfile-static'
9+
- "versions.txt"
10+
- "prepare.sh"
11+
- "Dockerfile-static"
1112

1213
jobs:
1314
build-and-push:
@@ -44,6 +45,7 @@ jobs:
4445
push: true
4546
tags: jumpserver/web-static:${{ env.IMAGE_TAG }}
4647
file: Dockerfile-static
48+
context: .
4749

4850
- name: Get current branch name
4951
id: get_branch

Dockerfile

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,36 @@ ARG VERSION=dev
22
FROM jumpserver/lina:${VERSION} AS lina
33
FROM jumpserver/luna:${VERSION} AS luna
44

5-
FROM nginx:1.29-trixie
5+
FROM nginx:1.31-trixie
66
ARG TARGETARCH
77

8-
ARG CHECK_VERSION=v1.0.5
98
ARG APT_MIRROR=http://deb.debian.org
109

1110
ARG TOOLS=" \
1211
ca-certificates \
1312
wget \
14-
curl \
15-
vim \
1613
logrotate \
1714
"
1815

1916
RUN set -ex \
2017
&& rm -f /etc/apt/apt.conf.d/docker-clean \
2118
&& sed -i "s@http://.*.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources\
2219
&& apt-get update > /dev/null \
20+
&& apt-get -y upgrade \
2321
&& apt-get -y install --no-install-recommends ${TOOLS} \
22+
&& wget https://github.com/jumpserver-dev/healthcheck/releases/latest/download/check_linux_${TARGETARCH}.deb \
23+
&& dpkg -i check_linux_${TARGETARCH}.deb \
24+
&& apt-get purge -y wget \
25+
curl \
26+
nginx-module-xslt \
27+
nginx-module-njs \
28+
libxml2 \
29+
libxslt1.1 \
30+
libgd3 \
31+
&& apt-get -y autoremove \
2432
&& apt-get clean \
25-
&& wget https://github.com/jumpserver-dev/healthcheck/releases/download/${CHECK_VERSION}/check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
26-
&& tar -xf check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz \
27-
&& mv check /usr/local/bin/ \
28-
&& chown root:root /usr/local/bin/check \
29-
&& chmod 755 /usr/local/bin/check \
30-
&& rm -f check-${CHECK_VERSION}-linux-${TARGETARCH}.tar.gz
33+
&& rm -f check_linux_${TARGETARCH}.deb \
34+
&& rm -f /etc/nginx/conf.d/default.conf
3135

3236
WORKDIR /opt
3337

@@ -36,6 +40,5 @@ COPY --from=luna /opt/luna /opt/luna
3640
COPY versions.txt /opt/download/versions.txt
3741
COPY nginx.conf /etc/nginx/nginx.conf
3842
COPY includes /etc/nginx/includes
39-
COPY default.conf /etc/nginx/conf.d/default.conf
40-
COPY http_server.conf /etc/nginx/sites-enabled/http_server.conf
43+
COPY http_server.conf /etc/nginx/conf.d/http_server.conf
4144
COPY init.sh /docker-entrypoint.d/40-init-config.sh

Dockerfile-ee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG VERSION=dev
2-
FROM jumpserver/web-static:20260122_091122 AS static
2+
FROM jumpserver/web-static:20260617_103847 AS static
33
FROM jumpserver/web:${VERSION}-ce
44

55
COPY --from=static /opt/ /opt/

Dockerfile-static

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ARG TARGETARCH
33

44
WORKDIR /tmp
55
COPY . .
6+
67
RUN set -ex \
78
&& apk add --no-cache bash \
89
&& bash ./prepare.sh

http_server.conf

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,11 @@ server {
33
# listen [::]:80;
44
# server_name demo.jumpserver.org; # 取消注释并自行修改成你自己的域名
55

6-
client_max_body_size 5000m;
6+
client_max_body_size 4096m;
77

88
location / {
9-
proxy_pass http://localhost:51980;
10-
proxy_buffering off;
11-
proxy_request_buffering off;
12-
proxy_http_version 1.1;
13-
proxy_set_header Host $host;
14-
proxy_set_header Upgrade $http_upgrade;
15-
proxy_set_header Connection $http_connection;
16-
proxy_set_header X-Forwarded-For $remote_addr;
17-
proxy_ignore_client_abort on;
18-
proxy_connect_timeout 600;
19-
proxy_send_timeout 600;
20-
proxy_read_timeout 600;
21-
send_timeout 6000;
22-
}
9+
rewrite ^/(.*)$ /ui/$1 last;
10+
}
11+
12+
include includes/*.conf;
2313
}

includes/chen.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
location /chen/ {
2-
proxy_pass http://chen:8082;
2+
set $chen_upstream chen:8082;
3+
proxy_pass http://$chen_upstream;
34
proxy_buffering off;
45
proxy_http_version 1.1;
56
proxy_request_buffering off;

default.conf renamed to includes/common.conf

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
server {
2-
listen 51980;
3-
# listen [::]:51980;
4-
5-
client_max_body_size 5000m;
61

72
# For wecom verify
83
location ~* ^/WW_verify_[^.]+\.txt$ {
@@ -22,7 +17,7 @@ server {
2217

2318
location /web/health/ {
2419
access_log off;
25-
add_header Content-Type 'application/json';
20+
default_type application/json;
2621
return 200 '{"status": "ok"}';
2722
}
2823

@@ -47,12 +42,5 @@ server {
4742
}
4843

4944
location @redirect_oss {
50-
rewrite ^/download/(.*)$ https://static.jumpserver.org/download/$1 permanent;
51-
}
52-
53-
location / {
54-
rewrite ^/(.*)$ /ui/$1 last;
55-
}
56-
57-
include includes/*.conf;
58-
}
45+
rewrite ^/download/(.*)$ https://static.jumpserver.org/download/$1?v=osm;
46+
}

includes/core.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ location /private-media/ {
88
}
99

1010
location /ws/ {
11-
proxy_pass http://core:8080;
11+
set $core_upstream core:8080;
12+
proxy_pass http://$core_upstream;
1213
proxy_buffering off;
1314
proxy_http_version 1.1;
1415
proxy_set_header Upgrade $http_upgrade;
@@ -18,7 +19,8 @@ location /ws/ {
1819
}
1920

2021
location ~ ^/(core|api|media)/ {
21-
proxy_pass http://core:8080;
22+
set $core_upstream core:8080;
23+
proxy_pass http://$core_upstream;
2224
proxy_set_header Host $http_host;
2325
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
2426
proxy_ignore_client_abort on;

includes/koko.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
location /koko/ {
2-
proxy_pass http://koko:5000;
2+
set $koko_upstream koko:5000;
3+
proxy_pass http://$koko_upstream;
34
proxy_buffering off;
45
proxy_http_version 1.1;
56
proxy_request_buffering off;

includes/lion.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
location /lion/ {
2-
proxy_pass http://lion:8081;
2+
set $lion_upstream lion:8081;
3+
proxy_pass http://$lion_upstream;
34
proxy_buffering off;
45
proxy_http_version 1.1;
56
proxy_request_buffering off;

0 commit comments

Comments
 (0)