mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-13 03:10:47 +08:00
docker暴露一些目录
This commit is contained in:
parent
ca55f9917d
commit
626099f835
@ -7,10 +7,15 @@ build/
|
||||
**/node_modules/
|
||||
|
||||
# IDEs and editors
|
||||
/.idea
|
||||
.idea/
|
||||
|
||||
# misc
|
||||
**/.git*
|
||||
*.spec
|
||||
screenshots/
|
||||
README.md
|
||||
|
||||
# runtime data
|
||||
data/*
|
||||
!data/config.ini
|
||||
log/*
|
||||
|
16
Dockerfile
16
Dockerfile
@ -14,20 +14,22 @@ RUN wget https://nodejs.org/dist/v10.16.0/node-v10.16.0-linux-x64.tar.xz \
|
||||
&& ln -s /node-v10.16.0-linux-x64/bin/npm /usr/local/bin/npm
|
||||
|
||||
# 后端依赖
|
||||
COPY requirements.txt /blivechat/
|
||||
RUN pip3 install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r /blivechat/requirements.txt
|
||||
WORKDIR /blivechat
|
||||
COPY requirements.txt ./
|
||||
RUN pip3 install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
|
||||
|
||||
# 前端依赖
|
||||
WORKDIR /blivechat/frontend
|
||||
COPY frontend/package*.json ./
|
||||
WORKDIR ./frontend
|
||||
COPY frontend/package.json frontend/package-lock.json ./
|
||||
RUN npm i --registry=https://registry.npm.taobao.org
|
||||
|
||||
# 编译
|
||||
COPY . /blivechat
|
||||
# 编译前端
|
||||
COPY . ../
|
||||
RUN npm run build
|
||||
|
||||
# 运行
|
||||
WORKDIR /blivechat
|
||||
WORKDIR ..
|
||||
VOLUME /blivechat/data /blivechat/log /blivechat/frontend/dist
|
||||
EXPOSE 12450
|
||||
ENTRYPOINT ["python3", "main.py"]
|
||||
CMD ["--host", "0.0.0.0", "--port", "12450"]
|
||||
|
@ -65,7 +65,11 @@
|
||||
|
||||
### 四、Docker(自建服务器)
|
||||
1. ```sh
|
||||
docker run -d -p 12450:12450 xfgryujk/blivechat:latest
|
||||
docker run --name blivechat -d -p 12450:12450 \
|
||||
--mount source=blc-data,target=/blivechat/data \
|
||||
--mount source=blc-log,target=/blivechat/log \
|
||||
--mount source=blc-frontend,target=/blivechat/frontend/dist \
|
||||
xfgryujk/blivechat:latest
|
||||
```
|
||||
2. 用浏览器打开[http://localhost:12450](http://localhost:12450),以下略
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user