Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change docker db driver #5

Merged
merged 37 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1a2dcaa
[migrate] use Mirror configuration of KaiYuanShe
TechQuery Oct 5, 2023
3ef30d5
chore: update deploy configuration (#1)
wangrunlin Oct 25, 2023
16c23e8
fix: deploy Docker image path
wangrunlin Oct 25, 2023
d4268a4
Merge branch 'master'
TechQuery Nov 23, 2023
cea826c
[fix] Docker Compose network & volume
TechQuery Dec 23, 2023
500e764
Merge branch 'master'
TechQuery Mar 3, 2024
60130fc
[optimize] use shared AutoHeal service
TechQuery Mar 3, 2024
c56f412
feat: juicefs metaurl use pg
luojiyin1987 Mar 13, 2024
20df74d
fix: pg config
luojiyin1987 Mar 14, 2024
f1fb002
fix: pg save data in data dir
luojiyin1987 Mar 14, 2024
ee7cc10
fix: typo error
luojiyin1987 Mar 14, 2024
6c0fd73
fix: del SQLite config
luojiyin1987 Mar 14, 2024
9cee5b7
fix: to solve pg root does not exist
luojiyin1987 Mar 14, 2024
77cf039
torage wasb://polyfill4web/myjfs/ is not empty
luojiyin1987 Apr 18, 2024
cacb7d9
fix conflicts
luojiyin1987 Apr 18, 2024
72e1a3b
fix is not empty; please clean it up or pick another
luojiyin1987 Apr 20, 2024
736d3b7
caddy config
luojiyin1987 Apr 20, 2024
f40eee2
Merge branch 'master' into change-docker-db-driver
luojiyin1987 Apr 20, 2024
44005a4
yaml file format
luojiyin1987 Apr 21, 2024
146fc79
file save in docker volume
luojiyin1987 Apr 22, 2024
ff1f820
fix: cann't share volume
luojiyin1987 Apr 22, 2024
e4adba2
try to fix cann't share volume,but not work
luojiyin1987 Apr 27, 2024
77dde77
remove juicefs
luojiyin1987 May 31, 2024
67896eb
share rclone volume
luojiyin1987 May 31, 2024
e4cfd6d
change config
luojiyin1987 May 31, 2024
5122975
fix from review
luojiyin1987 May 31, 2024
1673aa9
add config demo
luojiyin1987 May 31, 2024
daa67da
add comment
luojiyin1987 May 31, 2024
b02269f
fix from review
luojiyin1987 May 31, 2024
c2a93c0
fix from review
luojiyin1987 May 31, 2024
4ead336
fix from review
luojiyin1987 May 31, 2024
10ea7f0
fix typo
luojiyin1987 May 31, 2024
7350b6a
fix from review
luojiyin1987 May 31, 2024
07f1e57
fix from review
luojiyin1987 May 31, 2024
53d7e61
fix from review
luojiyin1987 May 31, 2024
739751b
fix from review
luojiyin1987 May 31, 2024
ab6bb99
share file with local dir,no volume
luojiyin1987 May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/deploy-oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
tags:
- v*
env:
ARTIFACT_PATH: /tmp/artifact.tar
ARTIFACT_PATH: artifact.tar
BOX_NAME: api-service
BOX_URL: polyfiller/api-service

Expand Down Expand Up @@ -45,20 +45,21 @@ jobs:
uses: garygrossgarten/github-action-scp@release
with:
local: ./build
remote: /tmp
remote: /tmp/${{ env.BOX_NAME }}
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
privateKey: ${{ secrets.SSH_KEY }}
password: ${{ secrets.SSH_KEY }}

- name: Run Image
uses: garygrossgarten/github-action-ssh@release
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
privateKey: ${{ secrets.SSH_KEY }}
password: ${{ secrets.SSH_KEY }}
command: |
cd /tmp
mv docker-compose.yml .env start-docker.sh ~/
cd ~/
chmod +x ~/start-docker.sh
sudo ~/start-docker.sh ${{ env.ARTIFACT_PATH }}
cd /tmp/${{ env.BOX_NAME }}
mkdir -p ~/${{ env.BOX_NAME }}
mv docker-compose.yml .env start-docker.sh ~/${{ env.BOX_NAME }}
cd ~/${{ env.BOX_NAME }}
chmod +x ./start-docker.sh
echo ${{ secrets.SSH_KEY }} | sudo -S ./start-docker.sh /tmp/${{ env.BOX_NAME }}/${{ env.ARTIFACT_PATH }}
51 changes: 21 additions & 30 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
version: "3"

volumes:
polyfill-cache:
driver: juicedata/juicefs
driver_opts:
name: polyfill-cache
metaurl: postgres://postgres:${SECRET_KEY}@meta-server:5432/postgres
storage: ${STORAGE_TYPE}
bucket: ${BUCKET}
access-key: ${ACCESS_KEY}
secret-key: ${SECRET_KEY}

networks:
polyfiller:

Expand All @@ -21,34 +9,33 @@ services:
- /var/run/docker.sock:/var/run/docker.sock
restart: always

meta-server:
depends_on:
- autoheal
image: postgres
user: postgres
environment:
- POSTGRES_PASSWORD=${SECRET_KEY}
rclone:
luojiyin1987 marked this conversation as resolved.
Show resolved Hide resolved
image: rclone/rclone:latest
container_name: rclone_container
cap_add:
- SYS_ADMIN # Necessary for FUSE
- MKNOD # Necessary for FUSE
devices:
- "/dev/fuse" # Necessary for FUSE
security_opt:
- "apparmor:unconfined"
volumes:
- ./data:/var/lib/postgresql/data/
networks:
- polyfiller
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
retries: 5
labels:
- autoheal=true
- ./config/rclone:/config/rclone # Mount the local rclone config directory to the container
- ./metadata:/metadata:shared # Mount the local directory for the rclone mount
TechQuery marked this conversation as resolved.
Show resolved Hide resolved
command: "mount azure:/ /metadata --allow-other --allow-non-empty --vfs-cache-mode writes"
luojiyin1987 marked this conversation as resolved.
Show resolved Hide resolved
restart: always
environment:
- RCLONE_CONFIG=/config/rclone/rclone.conf # Path to the rclone config file inside the container
luojiyin1987 marked this conversation as resolved.
Show resolved Hide resolved

api-service:
depends_on:
- autoheal
- meta-server
- rclone
image: polyfiller/api-service
environment:
- NODE_ENV=production
volumes:
- polyfill-cache:/tmp/@wessberg/polyfiller
- metadata:/tmp/@wessberg/polyfiller
luojiyin1987 marked this conversation as resolved.
Show resolved Hide resolved
networks:
- polyfiller
healthcheck:
Expand All @@ -75,3 +62,7 @@ services:
- polyfiller
restart: always
command: caddy reverse-proxy --from polyfiller.app --to api-service:3000

volumes:
metadata:
driver: local
luojiyin1987 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion start-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
docker load < $1
docker image ls -a

docker-compose down --volumes
docker-compose down -v --remove-orphans
docker-compose up -d

docker image prune -a -f