mirror of
https://github.com/PGYER/codefever.git
synced 2026-05-06 21:50:39 +08:00
feat(doc): update doc
This commit is contained in:
54
codefever.build
Normal file
54
codefever.build
Normal file
@@ -0,0 +1,54 @@
|
||||
FROM pgyer/codefever-community-env-dry
|
||||
|
||||
MAINTAINER cubicwork@qq.com
|
||||
|
||||
WORKDIR /data/www/codefever-community
|
||||
|
||||
ENV GO111MODULE=off
|
||||
ENV GOPROXY=https://mirrors.aliyun.com/goproxy
|
||||
|
||||
RUN useradd -r www
|
||||
RUN useradd -rm git
|
||||
|
||||
# install dependencies
|
||||
RUN go get gopkg.in/yaml.v2
|
||||
|
||||
# copy repo
|
||||
RUN mkdir -p /data/www
|
||||
RUN git clone https://github.com/PGYER/codefever.git /data/www/codefever-community
|
||||
|
||||
EXPOSE 80 22
|
||||
|
||||
VOLUME ["/var/lib/mysql", "/data/www/codefever-community/env", "/data/www/codefever-community/application/logs", "/data/www/codefever-community/git-storage", "/data/www/codefever-community/file-storage"]
|
||||
|
||||
# build gateway
|
||||
RUN cd /data/www/codefever-community/http-gateway && go build main.go
|
||||
RUN cd /data/www/codefever-community/ssh-gateway/shell && go build main.go
|
||||
|
||||
# copy configs
|
||||
RUN cp ./misc/nginx.conf-template /usr/local/nginx/conf/nginx.conf
|
||||
RUN cp ./misc/php.ini-template /usr/local/php/etc/php.ini
|
||||
RUN cp ./misc/www.conf-template /usr/local/php/etc/php-fpm.d/www.conf
|
||||
RUN cp ./misc/php-fpm.conf-template /usr/local/php/etc/php-fpm.conf
|
||||
|
||||
# copy start scripts
|
||||
RUN cp ./misc/nginx-service-template /etc/init.d/nginx
|
||||
RUN cp ./misc/php-fpm-service-template /etc/init.d/php-fpm
|
||||
RUN cp ./misc/codefever-service-template /etc/init.d/codefever
|
||||
|
||||
# install composer dependencies
|
||||
RUN cd ./application/libraries/composerlib/ && /usr/local/php/bin/php ./composer.phar install
|
||||
|
||||
# create symbolic link
|
||||
RUN mkdir -p ./env && chmod -R 0777 ./env
|
||||
RUN ln -s ./env/env.yaml ./env.yaml && ln -s ./env/config.yaml ./config.yaml
|
||||
|
||||
# initialize container
|
||||
RUN chmod +x ./misc/initailize_container.sh ./misc/system_init.sh
|
||||
CMD ./misc/system_init.sh
|
||||
|
||||
# USAGE:
|
||||
# docker build --no-cache -f ./codefever.build -t pgyer/codefever-community .
|
||||
# docker container run -d --privileged=true --name codefever-test -p 40080:80 -p 40022:22 -v ~/config-test/db:/var/lib/mysql -v ~/config-test/env:/data/www/codefever-community/env -v ~/config-test/logs:/data/www/codefever-community/application/logs -v ~/config-test/git-storage:/data/www/codefever-community/git-storage -v ~/config-test/file-storage:/data/www/codefever-community/file-storage -it pgyer/codefever-community
|
||||
# docker container run -d --privileged=true --name codefever -p 80:80 -p 22:22 -v ~/config/db:/var/lib/mysql -v ~/config/env:/data/www/codefever-community/env -v ~/config/logs:/data/www/codefever-community/application/logs -v ~/config/git-storage:/data/www/codefever-community/git-storage -v ~/config/file-storage:/data/www/codefever-community/file-storage -it pgyer/codefever-community
|
||||
# docker push pgyer/codefever-community
|
||||
@@ -11,10 +11,19 @@
|
||||
启动 `CodeFever Communiy 版本` 的 `Docker 镜像`
|
||||
|
||||
```shell
|
||||
docker run -d --privileged=true --name codefever -p 80:80 -p 22:22 -it pgyer/codefever-community:latest /usr/sbin/init
|
||||
docker container run \
|
||||
-d --privileged=true --name codefever \
|
||||
-p 80:80 -p 22:22 \
|
||||
-v ~/config/db:/var/lib/mysql \
|
||||
-v ~/config/env:/data/www/codefever-community/env \
|
||||
-v ~/config/logs:/data/www/codefever-community/application/logs \
|
||||
-v ~/config/git-storage:/data/www/codefever-community/git-storage \
|
||||
-v ~/config/file-storage:/data/www/codefever-community/file-storage \
|
||||
-it pgyer/codefever-community
|
||||
```
|
||||
|
||||
1. 服务启动后尝试访问 `http://127.0.0.1` 或 `http://<server ip>` 登录
|
||||
1. 首次运行 Docker 镜像由于需要初始化 CodeFever, 可能需要 1-2 分钟才能访问。在初始化过程运行 `docker container logs codefever -f` 可以查看初始化进度, 当 `log` 中显示 `=== IMPORTANT NOTICE ===` 字样时, 初始化过程已经完成。
|
||||
1. 初始化完成后尝试访问 `http://127.0.0.1` 或 `http://<server ip>` 登录
|
||||
2. 如果你希望使用 `22` 端口作为 `Git` 的 `SSH 协议`端口,你需要在启动镜像前将宿主系统的 `SSH 服务` `端口` 先修改成其他端口
|
||||
3. 如果服务异常你可以登录 Shell 去人工维护, 也可以直接重启容器重启服务。
|
||||
4. 默认管理员用户: `root@codefever.cn`, 密码: `123456`。登录后请修改密码并绑定 MFA 设备。
|
||||
|
||||
Reference in New Issue
Block a user