Skip to content

Commit

Permalink
feat: add meilisync
Browse files Browse the repository at this point in the history
  • Loading branch information
yjl9903 committed Jan 15, 2024
1 parent ac5c937 commit 5ce703c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile.meilisync
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM long2ice/meilisync

WORKDIR /meilisync

ADD packages/database/meilisync.yml ./config.yml

RUN sed -i "s/\${POSTGRES_HOST}/${POSTGRES_HOST}/g" config.yml \
sed -i "s/\${POSTGRES_PORT}/${POSTGRES_PORT}/g" config.yml \
sed -i "s/\${POSTGRES_USERNAME}/${POSTGRES_USERNAME}/g" config.yml \
sed -i "s/\${POSTGRES_PASSWORD}/${POSTGRES_PASSWORD}/g" config.yml \
sed -i "s/\${POSTGRES_DATABASE}/${POSTGRES_DATABASE}/g" config.yml \
sed -i "s/\${MEILI_URL}/${MEILI_URL}/g" config.yml \
sed -i "s/\${MEILI_KEY}/${MEILI_KEY}/g" config.yml

CMD meilisync start
18 changes: 18 additions & 0 deletions packages/database/meilisync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
source:
type: postgres
host: ${POSTGRES_HOST}
port: ${POSTGRES_PORT}
user: ${POSTGRES_USERNAME}
password: ${POSTGRES_PASSWORD}
database: ${POSTGRES_DATABASE}

meilisearch:
api_url: ${MEILI_URL}
api_key: ${MEILI_KEY}
insert_size: 10000
insert_interval: 10

sync:
- table: resources
pk: id
full: true

0 comments on commit 5ce703c

Please sign in to comment.