LoginSignup
37
32

More than 3 years have passed since last update.

Qiitaっぽいpotmumのdockerイメージ作った

Last updated at Posted at 2016-01-20

potmum(ぽっとまむ)

特徴

  • 開発が続いている
  • Rails
  • 全文検索に対応
  • 画像のUPLOAD対応
    • ./public/attachment_files/1453(略)6d2.png のように保存される
  • 編集履歴
  • エディタ領域の自動インデント等

無い機能

  • 自動保存
  • 下書き
  • 自分の投稿のストック機能

動かし方

git clone https://github.com/tukiyo/dockercompose-potmum.git potmum
cd potmum
cp -a db/production.sqlite3.empty db/production.sqlite3
docker-compose up -d

docker-compose exec potmum bundle exec rake db:migrate

omniauth

2020年11月時点ではomniauthが使えなくなっているっぽいので、
USE_DEVELOPER でログインするのがよいです。

スクリーンショット_2020-11-04_07-14-02.png

ここで1個アカウントを作ります。

docker-compose.yml
environment:
  USE_DEVELOPER: 1

アカウントを引き継ぐには、authenticationsテーブルを修正する必要があります。
Githubからdeveloperに変更するには以下。

  • まず普通にpotmumの右上ログインから``

  • authentications.provider

    • githubからdeveloper
  • authentications.uid

    • 数値からログインIDへ。(例: admin1
  • usersテーブルに追加された分はdeveloperで作ったものは削除して良いです。

sqlite3を編集するにはsqlitebrowserが便利です。
apt install -y sqlitebrowserで入れられます。

古い情報

ログインし投稿するためにはGithubかSlack,Twitter連携、もしくはUSE_DEVELOPERが必要。

スクリーンショット_2017-04-13_08-19-31.png

バックアップ対象

  • db/production.sqlite3
  • attachment_files/

テーブル説明

  • articles : 記事のタイトル
  • revisions : 記事の内容
記事の一括出力
SELECT
  a.id
, a.title
, a.created_at
, r.tags_text
, r.body
FROM articles AS a
LEFT JOIN (SELECT MAX(id), article_id, tags_text, body FROM revisions GROUP BY article_id) AS r
ON a.id = r.article_id
  • sqlitebrowserを使うと便利。apt install -y sqlitebrowser

2020年現在、自分が使用しているイメージ

  • tukiyo3/potmum:20170807
37
32
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
37
32