A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
at main 48 lines 1.1 kB view raw
1# Build stage 2FROM golang:1.24-alpine AS builder 3 4# Install build dependencies 5RUN apk add --no-cache git gcc musl-dev 6 7WORKDIR /build 8 9# Copy go mod files 10COPY go.mod go.sum ./ 11RUN go mod download 12 13# Copy source code 14COPY . . 15 16# Build the binary 17RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -ldflags="-s -w" -o markedit ./cmd/server 18 19# Runtime stage 20FROM alpine:latest 21 22# Install ca-certificates for HTTPS and git for git operations 23RUN apk --no-cache add ca-certificates git 24 25WORKDIR /app 26 27# Copy binary from builder 28COPY --from=builder /build/markedit . 29 30# Copy migrations 31COPY --from=builder /build/internal/database/migrations ./internal/database/migrations 32 33# Create data directories 34RUN mkdir -p /app/data/repos 35 36# Expose port 37EXPOSE 8080 38 39# Run as non-root user 40RUN adduser -D -u 1000 markedit 41RUN chown -R markedit:markedit /app 42USER markedit 43 44# Health check 45HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ 46 CMD wget --no-verbose --tries=1 --spider http://localhost:8080/api/health || exit 1 47 48CMD ["./markedit"]