mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-27 07:16:19 +09:00
chore: update docker compose image
This commit is contained in:
@@ -3,11 +3,13 @@ name: Docker
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
tags: ["v*.*.*"]
|
tags: ["v*"]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
- "**.md"
|
- "**.md"
|
||||||
- "devenv/**"
|
- "devenv/**"
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
@@ -52,7 +54,7 @@ jobs:
|
|||||||
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
|
ghcr.io/${{ github.repository_owner }}/${{ matrix.image }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }}
|
type=raw,value=dev,enable=${{ github.ref == 'refs/heads/main' }}
|
||||||
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, '-') }}
|
type=raw,value=latest,enable=${{ github.event_name == 'release' || (startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, '-')) }}
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
type=semver,pattern={{version}}
|
type=semver,pattern={{version}}
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
@@ -71,14 +73,14 @@ jobs:
|
|||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
if: github.event_name == 'push'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
@@ -90,7 +92,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ${{ matrix.dockerfile }}
|
file: ${{ matrix.dockerfile }}
|
||||||
push: ${{ github.event_name == 'push' }}
|
push: ${{ github.event_name != 'pull_request' }}
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
platforms: ${{ startsWith(github.ref, 'refs/tags/') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
|
platforms: ${{ startsWith(github.ref, 'refs/tags/') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ cd Memoh
|
|||||||
sudo docker compose up -d
|
sudo docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> If you experience slow image pulls, use the CN override:
|
||||||
|
```bash
|
||||||
|
sudo docker compose -f docker-compose.yml -f docker/docker-compose.cn.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
> On macOS or if your user is in the `docker` group, `sudo` is not required.
|
> On macOS or if your user is in the `docker` group, `sudo` is not required.
|
||||||
|
|
||||||
Visit <http://localhost:8082> after startup. Default login: `admin` / `admin123`
|
Visit <http://localhost:8082> after startup. Default login: `admin` / `admin123`
|
||||||
|
|||||||
@@ -44,6 +44,11 @@ cd Memoh
|
|||||||
sudo docker compose up -d
|
sudo docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> 若镜像拉取较慢,可使用中国大陆镜像源配置:
|
||||||
|
```bash
|
||||||
|
sudo docker compose -f docker-compose.yml -f docker/docker-compose.cn.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
> macOS 或用户已在 `docker` 用户组中时,无需 `sudo`。
|
> macOS 或用户已在 `docker` 用户组中时,无需 `sudo`。
|
||||||
|
|
||||||
启动后访问 <http://localhost:8082>。默认登录:`admin` / `admin123`
|
启动后访问 <http://localhost:8082>。默认登录:`admin` / `admin123`
|
||||||
|
|||||||
+4
-23
@@ -39,13 +39,7 @@ services:
|
|||||||
- memoh-network
|
- memoh-network
|
||||||
|
|
||||||
migrate:
|
migrate:
|
||||||
build:
|
image: memohai/server:latest
|
||||||
context: .
|
|
||||||
dockerfile: docker/Dockerfile.server
|
|
||||||
args:
|
|
||||||
- VERSION=${MEMOH_VERSION:-dev}
|
|
||||||
- COMMIT_HASH=${MEMOH_COMMIT:-unknown}
|
|
||||||
- BUILD_TIME=${MEMOH_BUILD_TIME:-unknown}
|
|
||||||
container_name: memoh-migrate
|
container_name: memoh-migrate
|
||||||
entrypoint: ["/app/memoh-server", "migrate", "up"]
|
entrypoint: ["/app/memoh-server", "migrate", "up"]
|
||||||
volumes:
|
volumes:
|
||||||
@@ -58,13 +52,7 @@ services:
|
|||||||
- memoh-network
|
- memoh-network
|
||||||
|
|
||||||
server:
|
server:
|
||||||
build:
|
image: memohai/server:latest
|
||||||
context: .
|
|
||||||
dockerfile: docker/Dockerfile.server
|
|
||||||
args:
|
|
||||||
- VERSION=${MEMOH_VERSION:-dev}
|
|
||||||
- COMMIT_HASH=${MEMOH_COMMIT:-unknown}
|
|
||||||
- BUILD_TIME=${MEMOH_BUILD_TIME:-unknown}
|
|
||||||
container_name: memoh-server
|
container_name: memoh-server
|
||||||
privileged: true
|
privileged: true
|
||||||
pid: host
|
pid: host
|
||||||
@@ -86,9 +74,7 @@ services:
|
|||||||
- memoh-network
|
- memoh-network
|
||||||
|
|
||||||
agent:
|
agent:
|
||||||
build:
|
image: memohai/agent:latest
|
||||||
context: .
|
|
||||||
dockerfile: docker/Dockerfile.agent
|
|
||||||
container_name: memoh-agent
|
container_name: memoh-agent
|
||||||
volumes:
|
volumes:
|
||||||
- ${MEMOH_CONFIG:-./conf/app.docker.toml}:/config.toml:ro
|
- ${MEMOH_CONFIG:-./conf/app.docker.toml}:/config.toml:ro
|
||||||
@@ -102,12 +88,7 @@ services:
|
|||||||
- memoh-network
|
- memoh-network
|
||||||
|
|
||||||
web:
|
web:
|
||||||
build:
|
image: memohai/web:latest
|
||||||
context: .
|
|
||||||
dockerfile: docker/Dockerfile.web
|
|
||||||
args:
|
|
||||||
- VITE_API_URL=${VITE_API_URL:-/api}
|
|
||||||
- VITE_AGENT_URL=${VITE_AGENT_URL:-/agent}
|
|
||||||
container_name: memoh-web
|
container_name: memoh-web
|
||||||
ports:
|
ports:
|
||||||
- "8082:8082"
|
- "8082:8082"
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: memoh.cn/postgres:18-alpine
|
||||||
|
qdrant:
|
||||||
|
image: memoh.cn/qdrant/qdrant:latest
|
||||||
|
migrate:
|
||||||
|
image: memoh.cn/memohai/server:latest
|
||||||
|
server:
|
||||||
|
image: memoh.cn/memohai/server:latest
|
||||||
|
agent:
|
||||||
|
image: memoh.cn/memohai/agent:latest
|
||||||
|
web:
|
||||||
|
image: memoh.cn/memohai/web:latest
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
name: "memoh"
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres:18-alpine
|
||||||
|
container_name: memoh-postgres
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: memoh
|
||||||
|
POSTGRES_USER: memoh
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-memoh123}
|
||||||
|
volumes:
|
||||||
|
- postgres_data:/var/lib/postgresql
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
expose:
|
||||||
|
- "5432"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U memoh"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- memoh-network
|
||||||
|
|
||||||
|
qdrant:
|
||||||
|
image: qdrant/qdrant:latest
|
||||||
|
container_name: memoh-qdrant
|
||||||
|
volumes:
|
||||||
|
- qdrant_data:/qdrant/storage
|
||||||
|
expose:
|
||||||
|
- "6333"
|
||||||
|
- "6334"
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- memoh-network
|
||||||
|
|
||||||
|
migrate:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.server
|
||||||
|
args:
|
||||||
|
- VERSION=${MEMOH_VERSION:-dev}
|
||||||
|
- COMMIT_HASH=${MEMOH_COMMIT:-unknown}
|
||||||
|
- BUILD_TIME=${MEMOH_BUILD_TIME:-unknown}
|
||||||
|
container_name: memoh-migrate
|
||||||
|
entrypoint: ["/app/memoh-server", "migrate", "up"]
|
||||||
|
volumes:
|
||||||
|
- ${MEMOH_CONFIG:-./conf/app.docker.toml}:/app/config.toml:ro
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: "no"
|
||||||
|
networks:
|
||||||
|
- memoh-network
|
||||||
|
|
||||||
|
server:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.server
|
||||||
|
args:
|
||||||
|
- VERSION=${MEMOH_VERSION:-dev}
|
||||||
|
- COMMIT_HASH=${MEMOH_COMMIT:-unknown}
|
||||||
|
- BUILD_TIME=${MEMOH_BUILD_TIME:-unknown}
|
||||||
|
container_name: memoh-server
|
||||||
|
privileged: true
|
||||||
|
pid: host
|
||||||
|
volumes:
|
||||||
|
- ${MEMOH_CONFIG:-./conf/app.docker.toml}:/app/config.toml:ro
|
||||||
|
- containerd_data:/var/lib/containerd
|
||||||
|
- server_cni_state:/var/lib/cni
|
||||||
|
- memoh_data:/opt/memoh/data
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
migrate:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
qdrant:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- memoh-network
|
||||||
|
|
||||||
|
agent:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.agent
|
||||||
|
container_name: memoh-agent
|
||||||
|
volumes:
|
||||||
|
- ${MEMOH_CONFIG:-./conf/app.docker.toml}:/config.toml:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
ports:
|
||||||
|
- "8081:8081"
|
||||||
|
depends_on:
|
||||||
|
- server
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- memoh-network
|
||||||
|
|
||||||
|
web:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.web
|
||||||
|
args:
|
||||||
|
- VITE_API_URL=${VITE_API_URL:-/api}
|
||||||
|
- VITE_AGENT_URL=${VITE_AGENT_URL:-/agent}
|
||||||
|
container_name: memoh-web
|
||||||
|
ports:
|
||||||
|
- "8082:8082"
|
||||||
|
depends_on:
|
||||||
|
- server
|
||||||
|
- agent
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- memoh-network
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres_data:
|
||||||
|
driver: local
|
||||||
|
qdrant_data:
|
||||||
|
driver: local
|
||||||
|
containerd_data:
|
||||||
|
driver: local
|
||||||
|
memoh_data:
|
||||||
|
driver: local
|
||||||
|
server_cni_state:
|
||||||
|
driver: local
|
||||||
|
|
||||||
|
networks:
|
||||||
|
memoh-network:
|
||||||
|
driver: bridge
|
||||||
Reference in New Issue
Block a user