Skip to content

Commit

Permalink
feat: update docker image publish workflow (hanfangyuan4396#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanfangyuan4396 authored Apr 3, 2024
1 parent 43b286c commit 68fb6a5
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 29 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-image-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:

jobs:
build-and-push-image:
if: github.repository == 'zhayujie/chatgpt-on-wechat'
if: github.repository == 'hanfangyuan4396/dify-on-wechat'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -65,8 +65,8 @@ jobs:

- uses: actions/delete-package-versions@v4
with:
package-name: 'chatgpt-on-wechat'
package-name: 'dify-on-wechat'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:

jobs:
build-and-push-image:
if: github.repository == 'zhayujie/chatgpt-on-wechat'
if: github.repository == 'hanfangyuan4396/dify-on-wechat'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -61,8 +61,8 @@ jobs:

- uses: actions/delete-package-versions@v4
with:
package-name: 'chatgpt-on-wechat'
package-name: 'dify-on-wechat'
package-type: 'container'
min-versions-to-keep: 10
delete-only-untagged-versions: 'true'
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
6 changes: 1 addition & 5 deletions docker/Dockerfile.latest
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
FROM python:3.10-slim-bullseye

LABEL maintainer="[email protected]"
LABEL maintainer="[email protected]"
ARG TZ='Asia/Shanghai'

ARG CHATGPT_ON_WECHAT_VER

RUN echo /etc/apt/sources.list
# RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
ENV BUILD_PREFIX=/app

ADD . ${BUILD_PREFIX}
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: '2.0'
services:
chatgpt-on-wechat:
image: zhayujie/chatgpt-on-wechat
container_name: chatgpt-on-wechat
image: hanfangyuan4396/dify-on-wechat
container_name: dify-on-wechat
security_opt:
- seccomp:unconfined
environment:
Expand Down
30 changes: 14 additions & 16 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
set -e

# build prefix
CHATGPT_ON_WECHAT_PREFIX=${CHATGPT_ON_WECHAT_PREFIX:-""}
DIFY_ON_WECHAT_PREFIX=${DIFY_ON_WECHAT_PREFIX:-""}
# path to config.json
CHATGPT_ON_WECHAT_CONFIG_PATH=${CHATGPT_ON_WECHAT_CONFIG_PATH:-""}
DIFY_ON_WECHAT_CONFIG_PATH=${DIFY_ON_WECHAT_CONFIG_PATH:-""}
# execution command line
CHATGPT_ON_WECHAT_EXEC=${CHATGPT_ON_WECHAT_EXEC:-""}
DIFY_ON_WECHAT_EXEC=${DIFY_ON_WECHAT_EXEC:-""}

# use environment variables to pass parameters
# if you have not defined environment variables, set them below
Expand All @@ -22,19 +22,19 @@ CHATGPT_ON_WECHAT_EXEC=${CHATGPT_ON_WECHAT_EXEC:-""}
# export CHARACTER_DESC=${CHARACTER_DESC:-"你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。"}
# export EXPIRES_IN_SECONDS=${EXPIRES_IN_SECONDS:-"3600"}

# CHATGPT_ON_WECHAT_PREFIX is empty, use /app
if [ "$CHATGPT_ON_WECHAT_PREFIX" == "" ] ; then
CHATGPT_ON_WECHAT_PREFIX=/app
# DIFY_ON_WECHAT_PREFIX is empty, use /app
if [ "$DIFY_ON_WECHAT_PREFIX" == "" ] ; then
DIFY_ON_WECHAT_PREFIX=/app
fi

# CHATGPT_ON_WECHAT_CONFIG_PATH is empty, use '/app/config.json'
if [ "$CHATGPT_ON_WECHAT_CONFIG_PATH" == "" ] ; then
CHATGPT_ON_WECHAT_CONFIG_PATH=$CHATGPT_ON_WECHAT_PREFIX/config.json
# DIFY_ON_WECHAT_CONFIG_PATH is empty, use '/app/config.json'
if [ "$DIFY_ON_WECHAT_CONFIG_PATH" == "" ] ; then
DIFY_ON_WECHAT_CONFIG_PATH=$DIFY_ON_WECHAT_PREFIX/config.json
fi

# CHATGPT_ON_WECHAT_EXEC is empty, use ‘python app.py’
if [ "$CHATGPT_ON_WECHAT_EXEC" == "" ] ; then
CHATGPT_ON_WECHAT_EXEC="python app.py"
# DIFY_ON_WECHAT_EXEC is empty, use ‘python app.py’
if [ "$DIFY_ON_WECHAT_EXEC" == "" ] ; then
DIFY_ON_WECHAT_EXEC="python app.py"
fi

# modify content in config.json
Expand All @@ -44,8 +44,6 @@ fi


# go to prefix dir
cd $CHATGPT_ON_WECHAT_PREFIX
cd $DIFY_ON_WECHAT_PREFIX
# excute
$CHATGPT_ON_WECHAT_EXEC


$DIFY_ON_WECHAT_EXEC

0 comments on commit 68fb6a5

Please sign in to comment.