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

[optimize] JuiceFS meta URL uses PostgreSQL #3

Merged
merged 7 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ Polyfiller is kindly supported by [JetBrains](https://www.jetbrains.com/?from=Po
- [FAQ](#faq)
- [What's the difference from polyfill.io](#whats-the-difference-from-polyfillio)
- [Hosting](#hosting)
- [Docker](#docker)
- [Simple container](#simple-container)
- [Composed services with Object Storage](#composed-services-with-object-storage)
- [1. Manual deployment](#1-manual-deployment)
- [2. Automatic deployment](#2-automatic-deployment)
- [Logo](#logo)
- [License](#license)
- [Feature names](#feature-names)
Expand Down Expand Up @@ -386,7 +391,7 @@ sudo docker plugin install juicedata/juicefs

###### 1. Manual deployment

1. Write [JuiceFS environment variables](https://juicefs.com/docs/community/juicefs_on_docker/#using-docker-compose) into `.env` file in the Project Root folder:
1. Write [JuiceFS object storage variables](https://juicefs.com/docs/community/reference/how_to_set_up_object_storage/) into `.env` file in the Project Root folder:

```ini
STORAGE_TYPE =
Expand Down
21 changes: 20 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volumes:
driver: juicedata/juicefs
driver_opts:
name: polyfill-cache
metaurl: sqlite3://polyfill-cache.db
metaurl: postgres://postgres:${METADATA_PASSWORD}@meta-server:5432/juicefs
storage: ${STORAGE_TYPE}
bucket: ${BUCKET}
access-key: ${ACCESS_KEY}
Expand All @@ -16,6 +16,8 @@ networks:

services:
api-service:
depends_on:
- meta-server
image: polyfiller/api-service
environment:
- NODE_ENV=production
Expand All @@ -37,6 +39,23 @@ services:
driver: json-file
options:
max-size: 10m

meta-server:
image: postgres
user: postgres
environment:
- POSTGRES_PASSWORD=${METADATA_PASSWORD}
volumes:
- ./data:/var/lib/postgresql/data/
networks:
- polyfiller
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres" ]
interval: 3s
retries: 5
labels:
- autoheal=true
restart: always

autoheal:
image: willfarrell/autoheal:1.2.0
Expand Down