forked from suyiiyii/AutoGLM-GUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (49 loc) · 1.77 KB
/
Dockerfile
File metadata and controls
66 lines (49 loc) · 1.77 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# ============================================
# AutoGLM-GUI Docker Image
# Multi-stage build: Node (frontend) + Python (backend)
# ============================================
# Stage 1: Build Frontend
FROM node:20-slim AS frontend
WORKDIR /app
# Enable corepack for pnpm
RUN corepack enable
# Copy frontend source
COPY frontend ./frontend
# Install dependencies and build
WORKDIR /app/frontend
RUN pnpm install --frozen-lockfile && pnpm build
# ============================================
# Stage 2: Build Backend
FROM python:3.11-slim AS backend
# Prevent Python from writing pyc files and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies
# - adb: Android Debug Bridge for device control
# - curl: For healthcheck
# - ca-certificates: For HTTPS connections
RUN apt-get update && apt-get install -y --no-install-recommends \
adb \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy Python project files
COPY pyproject.toml README.md ./
COPY AutoGLM_GUI ./AutoGLM_GUI
# Copy frontend build output from Stage 1 BEFORE pip install
# This ensures static files are included in the Python package
COPY --from=frontend /app/frontend/dist ./AutoGLM_GUI/static
# Install Python dependencies (now includes static files)
RUN pip install --no-cache-dir .
# Create directories for persistent data
RUN mkdir -p /root/.config/autoglm /app/logs
# Environment variables (can be overridden at runtime)
ENV AUTOGLM_CORS_ORIGINS="*"
# Expose the default port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8000/api/health || exit 1
# Default command
CMD ["autoglm-gui", "--host", "0.0.0.0", "--port", "8000", "--no-browser"]