@@ -24,13 +24,13 @@ title: Docker 部署
2424
2525 在 ` backend ` 目录中,创建环境变量文件
2626
27- ``` shell
27+ ``` shell:no-line-numbers
2828 touch .env
2929 ```
3030
3131 将初始化环境变量配置拷贝到环境变量文件中
3232
33- ``` shell
33+ ``` shell:no-line-numbers
3434 cp .env.example .env
3535 ```
3636
@@ -40,15 +40,15 @@ title: Docker 部署
4040
4141 如果容器要在本地启动,需要将 ` .env ` 中的 ` 127.0.0.1 ` 更改为 ` host.docker.internal `
4242
43- ``` shell
44- docker build -f backend/ Dockerfile -t fba_backend_independent .
43+ ``` shell:no-line-numbers
44+ docker build -f Dockerfile -t fba_backend_independent .
4545 ```
4646
47475 . 启动容器
4848
4949 由于构建不包含数据库,请确保本地已安装并启动相关数据库(mysql / postgresql、redis)
5050
51- ``` shell
51+ ``` shell:no-line-numbers
5252 docker run -d -p 8000:8000 --name fba_server fba_backend_independent
5353 ```
5454
@@ -85,7 +85,8 @@ title: Docker 部署
8585
8686 ::: warning
8787 如果你需要使用 PostgreSQL 数据库,执行命令前,需修改 ` .env.server ` 部分配置如下:
88- ``` env
88+ ``` env:no-line-numbers
89+ # Database
8990 DATABASE_TYPE='postgresql'
9091 DATABASE_HOST='fba_postgres'
9192 DATABASE_PORT=5432
@@ -102,8 +103,8 @@ title: Docker 部署
102103 services :
103104 fba_server :
104105 build :
105- context : ../../../
106- dockerfile : backend/ Dockerfile
106+ context : .
107+ dockerfile : Dockerfile
107108 image : fba_server:latest
108109 container_name : fba_server
109110 restart : always
@@ -247,8 +248,8 @@ title: Docker 部署
247248
248249 fba_celery :
249250 build :
250- context : ../../../
251- dockerfile : backend/ Dockerfile
251+ context : .
252+ dockerfile : Dockerfile
252253 args :
253254 - SERVER_TYPE=celery
254255 image : fba_celery:latest
@@ -298,7 +299,7 @@ title: Docker 部署
298299
299300 命令执行期间遇到镜像拉取问题请自行 Google
300301
301- ` ` ` shell
302+ ` ` ` shell:no-line-numbers
302303 docker-compose up -d --build
303304 ```
304305
@@ -311,14 +312,13 @@ title: Docker 部署
311312
3123131 . 拉取代码到服务器
3133142 . env
314-
315- :::: details Arco Desgin Vue
315+ ::: tabs
316+ @ tab < Icon name = " icon-park-outline:new-lark " /> Arco Desgin Vue
316317 修改 ` .env.production ` 中的 ` VITE_API_BASE_URL ` 为域名地址
317- ::::
318318
319- :::: details Vben Admin Antd
320- 即将到来 ...
321- ::::
319+ @ tab < Icon name = " devicon:antdesign " /> Vben Admin Antd
320+ 生产中 ...
321+ :::
322322
3233233 . 更新 nginx 配置
324324
@@ -461,19 +461,19 @@ title: Docker 部署
461461
462462 创建网络
463463
464- ` ` ` shell
464+ ` ` ` shell:no-line-numbers
465465 docker network create fba_network
466466 ```
467467
468468 构建
469469
470- ``` shell
470+ ``` shell:no-line-numbers
471471 docker-compose build fba_ui
472472 ```
473473
474474 启动
475475
476- ``` shell
476+ ``` shell:no-line-numbers
477477 docker-compose run fba_ui
478478 ```
479479
@@ -491,18 +491,18 @@ title: Docker 部署
491491
492492清理未使用的镜像
493493
494- ``` shell
494+ ``` shell:no-line-numbers
495495docker image prune
496496```
497497
498498清理未使用的容器
499499
500- ``` shell
500+ ``` shell:no-line-numbers
501501docker container prune
502502```
503503
504504清理所有未使用的镜像、容器、网络和构建缓存
505505
506- ``` shell
506+ ``` shell:no-line-numbers
507507docker system prune
508508```
0 commit comments