forked from MemTensor/MemOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (36 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
50 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# MemOS Production Dockerfile
# Multi-stage build with optimizations
# Stage 1: Install dependencies
FROM python:3.11-slim AS builder
RUN apt-get update && apt-get install -y \
gcc \
g++ \
build-essential \
libffi-dev \
python3-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY docker/requirements.txt .
RUN pip install --upgrade pip && \
pip install --prefix=/install --no-cache-dir -r requirements.txt
# Stage 2: Runtime image
FROM python:3.11-slim
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -m -u 1000 memos
WORKDIR /app
ENV HF_ENDPOINT=https://hf-mirror.com
ENV PYTHONPATH=/app/src
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
COPY --from=builder /install /usr/local
COPY src/ ./src
COPY docker/ ./docker
RUN chown -R memos:memos /app
USER memos
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
CMD ["uvicorn", "memos.api.server_api:app", "--host", "0.0.0.0", "--port", "8000"]