Skip to content

Commit bb5a1aa

Browse files
committed
perf: 优化容器
1 parent 04a7908 commit bb5a1aa

File tree

10 files changed

+12
-15
lines changed

10 files changed

+12
-15
lines changed

.github/workflows/issue-close.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Issue Close Check
22

33
on:
44
issues:
5-
types: [closed]
5+
types: [ closed ]
66

77
jobs:
88
issue-close-remove-labels:

.github/workflows/issue-comment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
on:
22
issue_comment:
3-
types: [created]
3+
types: [ created ]
44

55
name: Add issues workflow labels
66

.github/workflows/issue-open.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Issue Open Check
22

33
on:
44
issues:
5-
types: [opened]
5+
types: [ opened ]
66

77
jobs:
88
issue-open-add-labels:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ static/*
77
upload/*
88
common/utils/ip/geoip/GeoLite2-City.mmdb
99
common/utils/ip/ipip/ipipfree.ipdb
10+
config.yml

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ RUN echo > config.yml \
1111
sed -i "s@VERSION = .*@VERSION = '${VERSION}'@g" server/const.py; \
1212
fi
1313

14-
RUN set -ex \
15-
&& export SECRET_KEY=$(head -c100 < /dev/urandom | base64 | tr -dc A-Za-z0-9 | head -c 48)
16-
1714
FROM python:3.12.7-slim
1815

1916
ENV LANG=en_US.UTF-8 \

common/management/commands/services/hands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
DEBUG = CONFIG.DEBUG or False
3535
APPS_DIR = settings.BASE_DIR
3636
LOG_DIR = os.path.join(APPS_DIR, 'data', 'logs')
37-
TMP_DIR = os.path.join(APPS_DIR, 'data', 'tmp')
37+
TMP_DIR = os.path.join(APPS_DIR, 'tmp')
3838

3939

4040
def check_port_is_used():

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ service="${2-all}"
1313

1414
trap cleanup EXIT
1515

16-
rm -f logs/tmp/*.pid
16+
rm -f /data/xadmin-server/tmp/*.pid
1717

1818
if [[ "${action:0:1}" == "/" ]];then
1919
"$@"

server/const.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
PROJECT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1010
LOG_DIR = os.path.join(PROJECT_DIR, "data", "logs")
11-
TMP_DIR = os.path.join(PROJECT_DIR, "data", "tmp")
11+
TMP_DIR = os.path.join(PROJECT_DIR, "tmp")
1212
CELERY_LOG_DIR = os.path.join(LOG_DIR, "task")
13-
VERSION = '5.0.0'
13+
VERSION = '4.2.0'
1414
CONFIG = ConfigManager.load_user_config()
File renamed without changes.

xadmin.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,15 @@ function check_docker_start() {
5050
function check_permission() {
5151
project_parent_dir=$(dirname "${PROJECT_DIR}")
5252
mkdir -p "${project_parent_dir}"/xadmin-mariadb/{data,logs}
53-
if [ "$(stat -c %u logs)" -ne "1001" ] ;then
53+
if [ "$(stat -c %u data/logs)" -ne "1001" ] ;then
5454
chown 1001.1001 -R "${project_parent_dir}"/xadmin-mariadb/{data,logs}
5555
chown 1001.1001 -R "${project_parent_dir}"/xadmin-server/*
5656
fi
5757
}
5858

59+
function pull_images() {
60+
bash "${PROJECT_DIR}/utils/pull_docker_images.sh"
61+
}
5962

6063
EXE=""
6164

@@ -91,10 +94,6 @@ function restart() {
9194
start
9295
}
9396

94-
function pull_images() {
95-
bash "${PROJECT_DIR}/utils/pull_docker_images.sh"
96-
}
97-
9897
function import_tzinfo() {
9998
if ${EXE} ps|grep xadmin-mariadb|grep healthy &>/dev/null;then
10099
docker exec -it xadmin-mariadb sh -c 'mariadb-tzinfo-to-sql /usr/share/zoneinfo | mariadb -u root mysql && echo "import tzinfo success"'

0 commit comments

Comments
 (0)