0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

elabFTWをMacで動かす

0
Posted at

背景

elabFTWをインストールしたが、公式ドキュメントを見る限りでは対応プラットフォームに 64-bit GNU/Linux OS としか書かれていない

検証用に手元のMacでも動かしたかったのでMacで動かすための手順をまとめてみる

手順

公式サイトから docker-compose ファイルをダウンロード

わかりづらいのだがこちらのページに elabctl コマンドをインストールしたくない場合は docker-compose ファイルをダウンロードしてねと書いてある

curl -so docker-compose.yml "https://get.elabftw.net/?config"

このコマンドを実行するとカレントディレクトリに docker-compose.yml ファイルがダウンロードされるので開く

volumes, ports の項目を修正

docker-compose ファイルから volumes の項目を探して以下のように修正する

volumes:
        # this is where you will keep the uploaded files persistently
        # for Windows users it might look like this
        # - D:\Users\Nico\elab-data\web:/elabftw/uploads
        # host:container
        - ./web:/elabftw/uploads

MySQLの volume も同様に修正する

また ports の項目も以下のように修正する

ports:
        # Important note about exposing ports: due to the way Docker deals with the host firewall, it is recommended to use '127.0.0.1:1234:443'
        # if you only want to expose the service locally (on port 1234 in this example). See https://github.com/moby/moby/issues/22054
        # Another option is to use the "expose" directive instead of "ports" and let your reverse proxy figure things out.
        #
        # if you want elabftw to run on a different port, change the first number
        # host:container
        - '8080:443'

これによってローカルの 8080番port で開くことができるようになる

これはオプションだが、自分の場合はローカルのSQLクライアントからDBにアクセスできるようにしておきたかったので MySQL にも port の指定をした

    expose:
      - '3306'
    networks:
      - elabftw-net
    ports:
      - '3307:3306'

これにより以下のような設定でローカルのSQLクライアントからDBに接続できる

image.png

起動

ここまで終わったらカレントディレクトリで Docker イメージを起動する

docker compose up -d

起動したら初回のみDBのリセットが必要

docker exec -it elabftw bin/init db:install

終わったら https://localhost:8080 にアクセス

初回のみ警告が出るが、localhostにアクセスを選ぶ

image.png

あとはお好きなアカウントを登録すればOK

image.png

docker-compose ファイルの全文は以下の GitHub レポジトリにあげておいたので参考まで

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?