-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
88 lines (81 loc) · 3.07 KB
/
Copy pathDockerfile
File metadata and controls
88 lines (81 loc) · 3.07 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
79
80
81
82
83
84
85
86
87
88
# syntax=docker/dockerfile:1.7
ARG GO_VERSION=1.26.1
ARG NODE_VERSION=24
ARG VERSION=dev
FROM node:${NODE_VERSION}-bookworm-slim AS ui-builder
WORKDIR /src/ui
COPY ui/package*.json ./
RUN npm ci
COPY ui/ ./
RUN npm run build
FROM golang:${GO_VERSION}-bookworm AS go-builder
WORKDIR /src
ARG VERSION
ARG TARGETARCH
ENV CGO_ENABLED=0
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=ui-builder /src/ui/dist ./ui/dist
RUN GOOS=linux GOARCH="${TARGETARCH}" \
go build -buildvcs=false -trimpath \
-ldflags "-s -w -X main.version=${VERSION} -X github.com/startvibecoding/mothx/internal/ua.Version=${VERSION}" \
-o /out/mothx ./cmd/mothx
FROM ubuntu:24.04 AS runtime-ubuntu
ARG VERSION=dev
LABEL org.opencontainers.image.source="https://github.com/startvibecoding/mothx" \
org.opencontainers.image.title="MothX" \
org.opencontainers.image.description="MothX terminal AI coding assistant" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.base.name="ubuntu:24.04"
RUN apt-get update \
&& apt-get install -y --no-install-recommends bash ca-certificates curl git openssh-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY --from=go-builder /out/mothx /usr/local/bin/mothx
USER root
ENTRYPOINT ["mothx"]
FROM debian:bookworm-slim AS runtime-debian
ARG VERSION=dev
LABEL org.opencontainers.image.source="https://github.com/startvibecoding/mothx" \
org.opencontainers.image.title="MothX" \
org.opencontainers.image.description="MothX terminal AI coding assistant" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.base.name="debian:bookworm-slim"
RUN apt-get update \
&& apt-get install -y --no-install-recommends bash ca-certificates curl git openssh-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
COPY --from=go-builder /out/mothx /usr/local/bin/mothx
USER root
ENTRYPOINT ["mothx"]
FROM fedora:42 AS runtime-fedora
ARG VERSION=dev
LABEL org.opencontainers.image.source="https://github.com/startvibecoding/mothx" \
org.opencontainers.image.title="MothX" \
org.opencontainers.image.description="MothX terminal AI coding assistant" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.base.name="fedora:42"
RUN dnf -y install bash ca-certificates curl git openssh-clients \
&& dnf clean all \
&& rm -rf /var/cache/dnf
WORKDIR /workspace
COPY --from=go-builder /out/mothx /usr/local/bin/mothx
USER root
ENTRYPOINT ["mothx"]
FROM alpine:3.22 AS runtime-alpine
ARG VERSION=dev
LABEL org.opencontainers.image.source="https://github.com/startvibecoding/mothx" \
org.opencontainers.image.title="MothX" \
org.opencontainers.image.description="MothX terminal AI coding assistant" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.base.name="alpine:3.22"
RUN apk add --no-cache bash ca-certificates curl git openssh-client
WORKDIR /workspace
COPY --from=go-builder /out/mothx /usr/local/bin/mothx
USER root
ENTRYPOINT ["mothx"]