Skip to content

Commit 52a7ea6

Browse files
committed
汉化修改
1 parent 5d396b7 commit 52a7ea6

30 files changed

+1160
-920
lines changed

.dockerignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,5 @@
1515
!server/**
1616
!tailwind.config.js
1717
!vite.config.js
18-
19-
图片/
20-
21-
node_modules/
18+
!sources.list
19+
!编辑器汉化.sh

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,3 +248,5 @@ dist
248248
.vscode/
249249
data/
250250
/notes/
251+
252+
client/dist/

.htmlnanorc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"minifySvg": false
3+
}

Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG BUILD_DIR=/build
22

3-
# Build Container
4-
FROM --platform=$BUILDPLATFORM node:20-alpine AS build
3+
# 编译前端
4+
FROM --platform=$BUILDPLATFORM node:20.19.0-alpine3.21 AS build
55

66
ARG BUILD_DIR
77

@@ -14,14 +14,15 @@ COPY .htmlnanorc \
1414
postcss.config.js \
1515
tailwind.config.js \
1616
vite.config.js \
17+
编辑器汉化.sh \
1718
./
1819

1920
RUN npm ci
2021

2122
COPY client ./client
22-
RUN npm run build
23+
RUN npm run build && sh 编辑器汉化.sh
2324

24-
# Runtime Container
25+
# 运行后端
2526
FROM python:3.11-slim-bullseye
2627

2728
ARG BUILD_DIR
@@ -38,12 +39,16 @@ ENV FLATNOTES_PATH=/data
3839
RUN mkdir -p ${APP_PATH}
3940
RUN mkdir -p ${FLATNOTES_PATH}
4041

42+
## 复制系统源
43+
COPY sources.list /etc/apt/
4144
RUN apt update && apt install -y \
4245
curl \
4346
gosu \
4447
&& rm -rf /var/lib/apt/lists/*
4548

46-
RUN pip install --no-cache-dir pipenv
49+
50+
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple && \
51+
pip install --no-cache-dir pipenv
4752

4853
WORKDIR ${APP_PATH}
4954

@@ -62,3 +67,5 @@ EXPOSE ${FLATNOTES_PORT}/tcp
6267
HEALTHCHECK --interval=60s --timeout=10s CMD /healthcheck.sh
6368

6469
ENTRYPOINT [ "/entrypoint.sh" ]
70+
71+
## docker build -t firfe/flatnotes_zh-cn:5.5.3 .
File renamed without changes.

Dockerfile_原来

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
ARG BUILD_DIR=/build
2+
3+
# Build Container
4+
FROM --platform=$BUILDPLATFORM node:20-alpine AS build
5+
6+
ARG BUILD_DIR
7+
8+
RUN mkdir ${BUILD_DIR}
9+
WORKDIR ${BUILD_DIR}
10+
11+
COPY .htmlnanorc \
12+
package.json \
13+
package-lock.json \
14+
postcss.config.js \
15+
tailwind.config.js \
16+
vite.config.js \
17+
./
18+
19+
RUN npm ci
20+
21+
COPY client ./client
22+
RUN npm run build
23+
24+
# Runtime Container
25+
FROM python:3.11-slim-bullseye
26+
27+
ARG BUILD_DIR
28+
29+
ENV PUID=1000
30+
ENV PGID=1000
31+
ENV EXEC_TOOL=gosu
32+
ENV FLATNOTES_HOST=0.0.0.0
33+
ENV FLATNOTES_PORT=8080
34+
35+
ENV APP_PATH=/app
36+
ENV FLATNOTES_PATH=/data
37+
38+
RUN mkdir -p ${APP_PATH}
39+
RUN mkdir -p ${FLATNOTES_PATH}
40+
41+
RUN apt update && apt install -y \
42+
curl \
43+
gosu \
44+
&& rm -rf /var/lib/apt/lists/*
45+
46+
RUN pip install --no-cache-dir pipenv
47+
48+
WORKDIR ${APP_PATH}
49+
50+
COPY LICENSE Pipfile Pipfile.lock ./
51+
RUN pipenv install --deploy --ignore-pipfile --system && \
52+
pipenv --clear
53+
54+
COPY server ./server
55+
COPY --from=build --chmod=777 ${BUILD_DIR}/client/dist ./client/dist
56+
57+
COPY entrypoint.sh healthcheck.sh /
58+
RUN chmod +x /entrypoint.sh /healthcheck.sh
59+
60+
VOLUME /data
61+
EXPOSE ${FLATNOTES_PORT}/tcp
62+
HEALTHCHECK --interval=60s --timeout=10s CMD /healthcheck.sh
63+
64+
ENTRYPOINT [ "/entrypoint.sh" ]

Pipfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[[source]]
2-
name = "pypi"
3-
url = "https://pypi.org/simple"
2+
name = "aliyun"
3+
url = "https://mirrors.aliyun.com/pypi/simple"
44
verify_ssl = true
55

66
[dev-packages]
@@ -18,9 +18,11 @@ python-jose = {extras = ["cryptography"], version = "==3.4.0"}
1818
pyotp = "==2.9.0"
1919
qrcode = "==8.0"
2020
python-multipart = "==0.0.20"
21+
jieba = "==0.42.1"
2122

2223
[requires]
2324
python_version = "3.11"
2425

2526
[pipenv]
2627
allow_prereleases = true
28+

Pipfile.lock

Lines changed: 407 additions & 271 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)