-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (60 loc) · 2.06 KB
/
Dockerfile
File metadata and controls
78 lines (60 loc) · 2.06 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
67
68
69
70
71
72
73
74
75
76
77
78
# Dockerfile for MUXI Server
# Provides a containerized version of MUXI Server for users who prefer Docker
# over native installation.
#
# Usage:
# docker build -t ghcr.io/muxi-ai/muxi-server:latest .
# docker run -p 7890:7890 -v /var/run/docker.sock:/var/run/docker.sock \
# ghcr.io/muxi-ai/muxi-server:latest
#
# Note: Requires Docker socket mount to spawn formation containers
# Build stage
FROM golang:alpine AS builder
LABEL maintainer="MUXI AI <hello@muxi.org>"
LABEL org.opencontainers.image.source="https://github.com/muxi-ai/server"
# Install build dependencies
RUN apk add --no-cache git make
# Set working directory
WORKDIR /build
# Copy go mod files first (better caching)
COPY src/go.mod src/go.sum ./
RUN go mod download
# Copy source code
COPY src/ ./
# Build server binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo \
-ldflags="-w -s" \
-o muxi-server \
./cmd/server
# Verify binary was created
RUN test -f muxi-server && echo "✓ Build successful"
# Runtime stage
FROM alpine:latest
LABEL maintainer="MUXI AI <hello@muxi.org>"
LABEL org.opencontainers.image.source="https://github.com/muxi-ai/server"
LABEL description="MUXI Server - AI Formation Orchestrator"
LABEL version="1.0.0"
# Install runtime dependencies
RUN apk add --no-cache \
ca-certificates \
docker-cli \
&& rm -rf /var/cache/apk/*
# Create non-root user (optional - comment out if issues with Docker socket)
# RUN addgroup -g 1000 muxi && \
# adduser -D -u 1000 -G muxi muxi
# Copy server binary from builder
COPY --from=builder /build/muxi-server /usr/local/bin/muxi-server
# Create directories
RUN mkdir -p /root/.muxi/server/formations \
/root/.muxi/server/runtimes \
/root/.muxi/server/logs
# Expose MUXI Server port
EXPOSE 7890
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:7890/health || exit 1
# Set working directory
WORKDIR /root/.muxi/server
# Default command: start server
ENTRYPOINT ["muxi-server"]
CMD ["serve"]