readysite / readysite.org / Dockerfile
1.1 KB
Dockerfile
# Builder Image (needs CGO for libsql)
FROM golang:1.24-bookworm AS builder

WORKDIR /src

COPY go.mod go.sum ./
RUN go mod download

COPY pkg/ pkg/
COPY readysite.org/ readysite.org/

WORKDIR /src
RUN go build -o /bin/readysite-org ./readysite.org

# Runner Image
FROM debian:bookworm-slim

# Install Node.js for esbuild runtime bundling, git for repo hosting,
# CA certificates for TLS, curl for health checks, and SSH client for Pro server setup
RUN apt-get update && apt-get install -y --no-install-recommends \
    ca-certificates \
    curl \
    git \
    openssh-client \
    && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
    && apt-get install -y nodejs \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

ENV PORT=5000
ENV ENV=production
EXPOSE 5000

WORKDIR /app

# Create directories
RUN mkdir -p /var/git /app/resources

# Copy binary
COPY --from=builder /bin/readysite-org /usr/local/bin/readysite-org

# Copy frontend source for runtime bundling
COPY readysite.org/frontend/ frontend/
COPY readysite.org/package.json package.json
RUN npm install

CMD ["readysite-org"]
← Back