Compare commits
5 commits
cdcc4d6a4a
...
881fd5f5d8
Author | SHA1 | Date | |
---|---|---|---|
881fd5f5d8 | |||
85dfc11ad8 | |||
90c86ef13c | |||
79fa164f3b | |||
f504c4baab |
11 changed files with 17594 additions and 17597 deletions
1
Makefile
1
Makefile
|
@ -27,6 +27,7 @@ rust-lint:
|
||||||
|
|
||||||
.PHONY: regenerate-entities
|
.PHONY: regenerate-entities
|
||||||
regenerate-entities:
|
regenerate-entities:
|
||||||
|
pnpm run migrate
|
||||||
cd packages/backend/native-utils && \
|
cd packages/backend/native-utils && \
|
||||||
sea-orm-cli generate entity \
|
sea-orm-cli generate entity \
|
||||||
--output-dir='src/model/entity' \
|
--output-dir='src/model/entity' \
|
||||||
|
|
|
@ -10,8 +10,3 @@ down:
|
||||||
.PHONY: up
|
.PHONY: up
|
||||||
up:
|
up:
|
||||||
podman-compose up --detach
|
podman-compose up --detach
|
||||||
sleep 2
|
|
||||||
podman-compose exec db psql \
|
|
||||||
--user=firefish \
|
|
||||||
--dbname=firefish_db \
|
|
||||||
--command='CREATE EXTENSION pgroonga;'
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ services:
|
||||||
redis:
|
redis:
|
||||||
image: docker.io/redis:7-alpine
|
image: docker.io/redis:7-alpine
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "26379:6379"
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: docker.io/groonga/pgroonga:latest-alpine-16
|
image: docker.io/groonga/pgroonga:latest-alpine-16
|
||||||
|
@ -13,4 +13,6 @@ services:
|
||||||
- "POSTGRES_USER=firefish"
|
- "POSTGRES_USER=firefish"
|
||||||
- "POSTGRES_DB=firefish_db"
|
- "POSTGRES_DB=firefish_db"
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "25432:5432"
|
||||||
|
volumes:
|
||||||
|
- "../neko/install.sql:/docker-entrypoint-initdb.d/install.sql:ro"
|
||||||
|
|
|
@ -40,6 +40,7 @@ services:
|
||||||
- .config/docker.env
|
- .config/docker.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./db:/var/lib/postgresql/data
|
- ./db:/var/lib/postgresql/data
|
||||||
|
- ./neko/install.sql:/docker-entrypoint-initdb.d/install.sql:ro
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
calcnet:
|
calcnet:
|
||||||
|
|
|
@ -33,13 +33,13 @@
|
||||||
port: 3000
|
port: 3000
|
||||||
db:
|
db:
|
||||||
host: localhost
|
host: localhost
|
||||||
port: 5432
|
port: 25432
|
||||||
db: firefish_db
|
db: firefish_db
|
||||||
user: firefish
|
user: firefish
|
||||||
pass: password
|
pass: password
|
||||||
redis:
|
redis:
|
||||||
host: localhost
|
host: localhost
|
||||||
port: 6379
|
port: 26379
|
||||||
```
|
```
|
||||||
|
|
||||||
コンテナを作り直すと簡単にデータベースを初期化できます。
|
コンテナを作り直すと簡単にデータベースを初期化できます。
|
||||||
|
|
|
@ -98,10 +98,10 @@
|
||||||
sudo -u postgres psql --command="CREATE DATABASE ${POSTGRES_DB} OWNER ${POSTGRES_USER} encoding = 'UTF8';"
|
sudo -u postgres psql --command="CREATE DATABASE ${POSTGRES_DB} OWNER ${POSTGRES_USER} encoding = 'UTF8';"
|
||||||
```
|
```
|
||||||
|
|
||||||
7. PGroonga を有効化する
|
7. データベースに変更を加える
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo -u postgres psql --dbname="${POSTGRES_DB}" --command='CREATE EXTENSION pgroonga;'
|
sudo -u postgres psql --dbname="${POSTGRES_DB}" --file=neko/install.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
8. Firefish をビルドする
|
8. Firefish をビルドする
|
||||||
|
@ -201,19 +201,7 @@ x86_64 アーキテクチャの Linux のマシン上では、[`registry.code.na
|
||||||
./update.sh --install --podman
|
./update.sh --install --podman
|
||||||
```
|
```
|
||||||
|
|
||||||
6. データベースのコンテナのみを起動する
|
6. Firefish を起動する
|
||||||
|
|
||||||
```bash
|
|
||||||
podman-compose up db --detach
|
|
||||||
```
|
|
||||||
|
|
||||||
7. PGroonga を有効にする(`firefish` と `firefish_db` はそれぞれ自分が決めたユーザー名とデータベース名に変えて実行する)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
podman-compose exec db psql --user=firefish --dbname=firefish_db --command='CREATE EXTENSION pgroonga;'
|
|
||||||
```
|
|
||||||
|
|
||||||
8. Firefish を起動する
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
podman-compose up --detach
|
podman-compose up --detach
|
||||||
|
|
|
@ -90,10 +90,10 @@
|
||||||
db: firefish_db # これ
|
db: firefish_db # これ
|
||||||
```
|
```
|
||||||
|
|
||||||
11. 以下のコマンドを実行して PGroonga の拡張機能を有効にする(`firefish_db` の部分は自分のデータベース名に変えて実行)
|
11. 以下のコマンドを実行してデータベースに変更を加える(`firefish_db` の部分は自分のデータベース名に変えて実行)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo -u postgres psql --command="CREATE EXTENSION pgroonga;" --dbname=firefish_db
|
sudo -u postgres psql --dbname=firefish_db --file=neko/install.sql
|
||||||
```
|
```
|
||||||
|
|
||||||
12. 新しい Firefish のディレクトリに入ってビルドする
|
12. 新しい Firefish のディレクトリに入ってビルドする
|
||||||
|
@ -148,26 +148,34 @@ Docker を使う場合には以下の `podman`, `podman-compose`, `--podman` を
|
||||||
cp -r firefish.old/.config firefish
|
cp -r firefish.old/.config firefish
|
||||||
```
|
```
|
||||||
|
|
||||||
6. 以下のコマンドを実行して PGroonga を有効にする(`firefish` と `firefish_db` はそれぞれ `.config/docker.env` や `.config/default.yml` に書いた PostgreSQL のユーザー名とデータベース名に置き換える)
|
6. `docker-compose.yml` の設定例を複製する
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp firefish/docker-compose.example.yml firefish/docker-compose.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
`docker-compose.yml` にカスタムが必要な場合には、各自で編集してください。
|
||||||
|
|
||||||
|
7. 以下のコマンドを実行してデータベースに変更を加える
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
podman-compose up db --detach
|
podman-compose up db --detach
|
||||||
podman-compose exec db psql --command='CREATE EXTENSION pgroonga;' --user=firefish --dbname=firefish_db
|
podman-compose exec db sh -c 'psql --user="${POSTGRES_USER}" --dbname="${POSTGRES_DB}" --file=/docker-entrypoint-initdb.d/install.sql'
|
||||||
```
|
```
|
||||||
|
|
||||||
7. コンテナイメージをダウンロードまたはビルドする
|
8. コンテナイメージをダウンロードまたはビルドする
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./update.sh --install --podman
|
./update.sh --install --podman
|
||||||
```
|
```
|
||||||
|
|
||||||
8. サーバーを起動して動作を確認する
|
9. サーバーを起動して動作を確認する
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
podman-compose up --detach
|
podman-compose up --detach
|
||||||
```
|
```
|
||||||
|
|
||||||
9. 元々 Firefish がインストールされていたディレクトリを削除する
|
10. 元々 Firefish がインストールされていたディレクトリを削除する
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ..
|
cd ..
|
||||||
|
|
|
@ -200,6 +200,8 @@ Docker を使う場合には以下の `podman`, `podman-compose`, `--podman` を
|
||||||
podman-compose up --detach
|
podman-compose up --detach
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`docker-compose.yml` にカスタムが必要な場合には、各自で編集してください。
|
||||||
|
|
||||||
14. 元々 Firefish がインストールされていたディレクトリを削除する
|
14. 元々 Firefish がインストールされていたディレクトリを削除する
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
1
neko/install.sql
Normal file
1
neko/install.sql
Normal file
|
@ -0,0 +1 @@
|
||||||
|
CREATE EXTENSION IF NOT EXISTS pgroonga;
|
17565
neko/pnpm-lock.yaml
generated
17565
neko/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
1
pnpm-lock.yaml
generated
1
pnpm-lock.yaml
generated
|
@ -1 +0,0 @@
|
||||||
neko/pnpm-lock.yaml
|
|
17565
pnpm-lock.yaml
generated
Normal file
17565
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue