Skip to content

Commit 33921b7

Browse files
author
harvey_xiang
committed
feat: add dockerfile
1 parent b144470 commit 33921b7

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Base image
2+
FROM registry.cn-shanghai.aliyuncs.com/memtensor/memos:amd-v1.2
3+
4+
# Set Hugging Face mirror
5+
ENV HF_ENDPOINT=https://hf-mirror.com
6+
7+
RUN rm -rf /app/
8+
9+
WORKDIR /app
10+
11+
COPY . /app/
12+
13+
# Set Python import path
14+
ENV PYTHONPATH=/app/src
15+
RUN pip install pymilvus
16+
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && pip config set install.trusted-host mirrors.aliyun.com
17+
RUN aliyun-bootstrap -a install
18+
19+
# Expose port
20+
EXPOSE 9002
21+
22+
# Start the docker
23+
CMD ["uvicorn", "memos.api.product_api:app", "--host", "0.0.0.0", "--port", "9002", "--reload"]

docker-compose.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: memos-dev
2+
3+
services:
4+
memos:
5+
container_name: memos-api-docker
6+
build:
7+
context: ..
8+
dockerfile: docker/Dockerfile
9+
ports:
10+
- "8000:8000"
11+
env_file:
12+
- ../.env
13+
depends_on:
14+
- neo4j
15+
- qdrant
16+
environment:
17+
- PYTHONPATH=/app/src
18+
- HF_ENDPOINT=https://hf-mirror.com
19+
volumes:
20+
- ../src:/app/src
21+
- .:/app/docker
22+
networks:
23+
- memos_network
24+
25+
neo4j:
26+
image: neo4j:5.26.4
27+
container_name: neo4j-docker
28+
ports:
29+
- "7474:7474" # HTTP
30+
- "7687:7687" # Bolt
31+
healthcheck:
32+
test: wget http://localhost:7687 || exit 1
33+
interval: 1s
34+
timeout: 10s
35+
retries: 20
36+
start_period: 3s
37+
environment:
38+
NEO4J_ACCEPT_LICENSE_AGREEMENT: "yes"
39+
NEO4J_AUTH: "neo4j/12345678"
40+
volumes:
41+
- neo4j_data:/data
42+
- neo4j_logs:/logs
43+
networks:
44+
- memos_network
45+
46+
qdrant:
47+
image: qdrant/qdrant:v1.15.0
48+
container_name: qdrant-docker
49+
ports:
50+
- "6333:6333" # REST API
51+
- "6334:6334" # gRPC API
52+
volumes:
53+
- ./qdrant_data:/qdrant/storage
54+
environment:
55+
QDRANT__SERVICE__GRPC_PORT: 6334
56+
QDRANT__SERVICE__HTTP_PORT: 6333
57+
restart: unless-stopped
58+
networks:
59+
- memos_network
60+
61+
volumes:
62+
neo4j_data:
63+
neo4j_logs:
64+
65+
networks:
66+
memos_network:
67+
driver: bridge

0 commit comments

Comments
 (0)