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?

コンテナ起動をdocker-compose.yamlでの起動に変更

Last updated at Posted at 2025-08-14

コンテナ起動をdocker-compose.yamlでの起動に変更

1)設定値

1−1)ollama

コンテナ名:ollama
利用ポート番号:11434
ホストから見るデータ保存エリア(永続化ディレクトリ):/docker_data/ollama

1−2)Open WebUI

コンテナ名:open-webui
利用ポート番号:3000
ホストから見るデータ保存エリア(永続化ディレクトリ):/docker_data/open-webui

2)環境ファイル編集設定、起動

vi ~/projects/ollama_openwebui/docker-compose.yaml

docker-compose.yamlファイルの中身

services:
  ollama:
    image: ollama/ollama
    container_name: ollama
    restart: always
    ports:
      - "11434:11434"
    volumes:
      - /docker_data/ollama:/root/.ollama
    gpus: all
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=compute,utility
      # VRAMに合わせて最大オフロード(自動がイマイチな場合の保険)
      - OLLAMA_NUM_GPU_LAYERS=-1

  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    container_name: open-webui
    restart: always
    ports:
      - "3000:8080"
    volumes:
      - /docker_data/open-webui:/app/backend/data
    extra_hosts:
      - "host.docker.internal:host-gateway"

cd ~/projects/ollama_openwebui/
sudo docker compose up -d

3)動作確認

sudo docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"

4)ログ確認

sudo docker logs -f open-webui
sudo docker logs -f ollama

5)[参考]停止方法

cd ~/projects/ollama_openwebui/
sudo docker compose down

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?