Skip to content

Commit 7ef9f39

Browse files
committed
Update peripheral & dockerfile(close #28)
1 parent 254686f commit 7ef9f39

File tree

7 files changed

+34
-30
lines changed

7 files changed

+34
-30
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ Feature
2525
-------
2626

2727
同样是在GitHub中新建 [Issue](https://github.com/sapicd/sapic/issues/new),提出功能需求,描述下其具体要求。
28+
非常欢迎提交PR以直接完成您的功能。
2829

2930
Pull Request
3031
------------
3132

33+
感谢提交代码,可按以下方式启动项目:
34+
3235
**首先是环境**
3336

3437
- Fork [sapic](https://github.com/sapicd/sapic)
@@ -37,7 +40,7 @@ Pull Request
3740

3841
如果您不是最新fork,需先同步最新代码,参考官方文档:[Syncing a fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork)
3942

40-
请在dev分支编写代码
43+
请尽量在dev分支编写代码
4144

4245
- 基础环境与安装过程参照 [sapic文档](https://sapic.rtfd.vip/install.html)
4346

@@ -49,7 +52,7 @@ Pull Request
4952

5053
- 如果可能,使用py3.8+运行测试(位于src): ``make test``
5154

52-
- 如果可能,请编写或更新文档,位于docs下,构建文档(py3):
55+
- 如果可能,请编写或更新对应文档,位于docs下,构建文档命令(py3):
5356

5457
```bash
5558
cd /path/to/sapic/docs

Dockerfile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
# -- build dependencies with debian(multiarch) --
2-
FROM python:3.8-slim AS build
1+
# -- build and run with debian(multiarch) --
2+
FROM python:3.9-slim
33
44
ARG PIPMIRROR=https://pypi.org/simple
5-
COPY requirements /requirements
6-
RUN pip install --timeout 30 --index $PIPMIRROR --user --no-cache-dir --no-warn-script-location -r /requirements/all.txt
7-
8-
# -- app environment(multiarch) --
9-
FROM python:3.8-alpine
10-
ARG ALPINEMIRROR=dl-cdn.alpinelinux.org
115
ENV sapic_isrun=true
12-
COPY --from=build /root/.local /root/.local
13-
RUN apk upgrade --no-cache && \
14-
apk add --no-cache libgcc libstdc++ gcompat && \
15-
pip install --no-cache-dir --user -U pip pillow && \
6+
COPY requirements /requirements
7+
RUN pip install --timeout 30 --index $PIPMIRROR --user --no-cache-dir --no-warn-script-location -r /requirements/all.txt && \
168
ln -sf /root/.local/bin/flask /root/.local/bin/gunicorn /bin/ && \
179
ln -sf $(which python) /python && \
1810
sed -i "s#$(which python)#/python#" /bin/gunicorn

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# sapic
22

33
即picbed,基于Flask的Web自建图床,
4-
支持存储到本地、又拍云、七牛云、阿里云OSS、腾讯云COS、GitHub、Gitee(码云)、S3等。
4+
支持存储到本地、又拍云、七牛云、阿里云OSS、腾讯云COS、GitHub、Gitee(码云)等,
5+
支持第三方扩展存储到[AWS S3](https://aws.amazon.com/s3/)[sm.ms](https://sm.ms/)[superbed聚合图床](https://www.superbed.cn)等。
56

67
[![Actions Status: ci](https://github.com/sapicd/sapic/workflows/ci/badge.svg)](https://github.com/sapicd/sapic/actions?query=workflow%3A%22build+and+test%22)
78
[![codecov](https://codecov.io/gh/sapicd/sapic/branch/master/graph/badge.svg)](https://codecov.io/gh/sapicd/sapic)
@@ -113,8 +114,9 @@ cd /path/to/sapic
113114
docker-compose exec webapp flask sa create -u 管理员账号 -p 密码 --isAdmin
114115
```
115116

116-
- Dockerfile采用分阶段构建,推送到Docker hub,latest标签是master分支,
117-
dev标签是dev分支,其他标签是已发布的版本。
117+
-------
118+
119+
- 镜像推送到 `Docker Hub`,latest 标签是 master 分支,dev 标签是 dev 分支,其他标签是已发布的版本。
118120

119121
- docker-compose.yml仅为简单定义,可以自行修改,比如加上nginx、redis挂载数据(/data)。
120122

@@ -150,6 +152,12 @@ http://demo.sapicd.com
150152

151153
![控制台管理员功能](./Snapshot/hook.png)
152154

155+
## 贡献者
156+
157+
感谢以下参与项目的人:
158+
159+
<a href="graphs/contributors"><img src="https://opencollective.com/sapic/contributors.svg?width=890&button=false" /></a>
160+
153161
## Contributing
154162

155163
感谢您的贡献!

docs/changelog.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ v1.16.1
1010
Released in 2023-1-9
1111

1212
- 修复:redis 3.x版本,cli创建用户失败,感谢 @moria
13-
- 更改:redis hmset 命令更换为 hset
1413
- 修复:docker pillow import error
14+
- 更改:docker运行时改为python3.9-slim
15+
- 更改:redis hmset 命令更换为 hset
1516

1617
v1.16.0
1718
--------

docs/docker.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ v1.4.0增加了Dockerfile文件,它使用alpine3.11 + python3.6,构建完成
5757

5858
.. versionchanged:: 1.16.1
5959

60-
采用python3.8版本,取消多阶段构建。
60+
采用python3.9-slim版本,避免Alpine镜像问题,镜像容量约180M,取消多阶段构建。
6161

6262
打包步骤如下:
6363

@@ -70,7 +70,7 @@ v1.4.0增加了Dockerfile文件,它使用alpine3.11 + python3.6,构建完成
7070

7171
.. code-block:: bash
7272
73-
$ docker build -t staugur/sapic . --build-arg PIPMIRROR=https://pypi.tuna.tsinghua.edu.cn/simple --build-arg ALPINEMIRROR=mirrors.ustc.edu.cn
73+
$ docker build -t staugur/sapic . --build-arg PIPMIRROR=https://pypi.tuna.tsinghua.edu.cn/simple
7474
7575
.. tip::
7676

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ sapic - 简约不小气的自建图床程序
2727
自 v1.12.0 正式命名:**sapic**
2828

2929
基于Flask的Web自建图床,默认存储在本地,
30-
内置支持又拍云、七牛云、阿里云OSS、腾讯云COS、S3等对象存储,支持GitHub、Gitee(码云)。
30+
内置支持本地、又拍云、七牛云、阿里云OSS、腾讯云COS、S3等对象存储,支持GitHub、Gitee(码云)。
3131

3232
GitHub: `sapicd/sapic <https://github.com/sapicd/sapic>`_
3333

docs/install.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ NO.1 启动Redis
7777
NO.2 部署程序
7878
---------------------
7979

80-
这是一个基于Python Flask框架写的web应用,依赖redis,部署要求python3.8+
80+
这是一个基于Python Flask框架写的web应用,依赖redis(建议4.0+),部署要求python3.8+
8181

8282
2.1. 下载源码
8383
^^^^^^^^^^^^^^^
@@ -89,18 +89,18 @@ dev分支的功能完成后会合并到master分支;
8989
一阶段功能完成会从master分支发版。
9090

9191
- 开发版(dev)
92-
! 建议,如果你有git,可以:\ ``git clone -b dev https://github.com/sapicd/sapic picbed``
92+
! 建议,如果你有git,可以:\ ``git clone -b dev https://github.com/sapicd/sapic sapic``
9393

9494
! 也可以下载压缩包:
9595

9696
.. code-block:: bash
9797
98-
$ wget -O picbed.zip https://codeload.github.com/sapicd/sapic/zip/dev
99-
$ unzip picbed.zip
100-
$ mv picbed-dev picbed
98+
$ wget -O sapic.zip https://codeload.github.com/sapicd/sapic/zip/dev
99+
$ unzip sapic.zip
100+
$ mv sapic-dev sapic
101101
102102
- 尝鲜版(master)
103-
``git clone https://github.com/sapicd/sapic picbed``
103+
``git clone https://github.com/sapicd/sapic sapic``
104104

105105
- 正式版(release)
106106
! 到 `release <https://github.com/sapicd/sapic/releases>`_ 页面下载正式版本的包。
@@ -112,7 +112,7 @@ dev分支的功能完成后会合并到master分支;
112112

113113
.. code-block:: bash
114114
115-
$ cd picbed
115+
$ cd sapic
116116
$ [建议]激活virtualenv、venv,当然也可以直接在全局模式下安装
117117
$ pip install -r requirements/all.txt # all可以换成具体env
118118
@@ -371,8 +371,8 @@ NO.5 程序升级
371371
- v1.8.0
372372
- 增加了依赖模块bleach和semver,可以手动安装:
373373

374-
.. code-block:: bash
375-
374+
.. code-block:: bash
375+
376376
$ pip install 'bleach>2.0.0' 'semver>=2.9.1,<3'
377377
378378
- 更改设计:已删除图片的数据直接删除,故此升级时可以清理历史遗留的key

0 commit comments

Comments
 (0)