File tree Expand file tree Collapse file tree 4 files changed +17
-36
lines changed
Expand file tree Collapse file tree 4 files changed +17
-36
lines changed Original file line number Diff line number Diff line change @@ -23,11 +23,11 @@ jobs:
2323
2424 # 构建 Docker 镜像
2525 - name : Build Docker image
26- run : docker-compose build
26+ run : docker-compose -f docker-compose-dev.yml build
2727
2828 # 检查镜像是否能成功启动一个容器
2929 - name : Run Docker container
30- run : docker-compose up -d
30+ run : docker-compose -f docker-compose-dev.yml up -d
3131
3232 # 检查容器状态
3333 - name : Check container status
@@ -45,15 +45,10 @@ jobs:
4545 fi
4646 echo "Container is running successfully."
4747
48- # 登录 Docker Hub
49- - name : Docker login
48+ # 推送镜像到 kworlds's Docker Hub
49+ - name : Push Docker image to Kworlds's Docker Hub
5050 if : success()
51- run : echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ vars.DOCKER_HUB_USERNAME }}" --password-stdin
52-
53- # 推送镜像到 Docker Hub
54- - name : Push Docker image to Docker Hub
55- if : success()
56- run : docker push immrk/pure-drf-api:latest
51+ run : docker push dockerhub.kworlds.cn/pure-drf-api:dev
5752
5853 # 更新开发环境镜像并重启容器
5954 - name : Deploy to remote server
Original file line number Diff line number Diff line change 11services :
22 api :
3- image : immrk /pure-drf-api:latest # 镜像名称 hub路径/镜像名称:版本号(tag)
3+ image : dockerhub.kworlds.cn /pure-drf-api:dev # 镜像名称 hub路径/镜像名称:版本号(tag)
44 build : .
55 ports :
66 - " 8000:8000"
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ services :
2+ api :
3+ image : dockerhub.kworlds.cn/pure-drf-api:latest # 镜像名称 hub路径/镜像名称:版本号(tag)
4+ build : .
5+ ports :
6+ - " 8000:8000"
7+ volumes :
8+ - ./logs:/app/logs # 映射 logs 目录
9+ - ./.env:/app/.env # 映射 .env 文件
10+ - ./db.sqlite3:/app/db.sqlite3 # 映射数据库文件
11+ - ./gunicorn.conf.py:/app/gunicorn.conf.py # 映射 Gunicorn 配置文件
You can’t perform that action at this time.
0 commit comments