HGRC Quarry Fossil Service
Simple tools for lasting software

Infrastructure as a Service / Nemoptera

A solid foundation to fork, tweak, and enhance.

Public | Owner: Infrastructure as a Service | Default branch: trunk | Last update: 2026-11-08 15:31

Artifact 45978728f3a866cd0fce8a45c17963f0ac76146b0ab6ec44265b315e688670a2:


# syntax=docker/dockerfile:1

# ---------------------------------------------------------------------
# Stage 1: Build application and dependencies
# ---------------------------------------------------------------------
FROM erlang:27-slim AS builder

WORKDIR /build

# Install build tools for compiling C NIFs (esqlite) and git for dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        git && \
    rm -rf /var/lib/apt/lists/*

# Cache dependency retrieval
COPY rebar.config rebar.lock ./
RUN rebar3 get-deps

# Copy configurations and source files
COPY config/ config/
COPY src/ src/

# Compile the application (rebar3 + rebar3_lfe)
RUN rebar3 compile

# ---------------------------------------------------------------------
# Stage 2: Runtime environment
# ---------------------------------------------------------------------
FROM erlang:27-slim

# Install runtime dependencies:
# - fossil: Fossil SCM binary managed by Nemoptera
# - git: Required for fossil git export / mirror synchronization
# - ca-certificates: Required for HTTPS operations (remote clone / sync)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        fossil \
        git \
        ca-certificates && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Copy compiled application, beam files, and priv directories (NIFs)
COPY --from=builder /build/_build/default/lib /app/_build/default/lib
COPY --from=builder /build/config /app/config
COPY --from=builder /build/src /app/src

# Setup entrypoint script and data directory
COPY docker-entrypoint.sh /app/docker-entrypoint.sh
RUN chmod +x /app/docker-entrypoint.sh && \
    mkdir -p /app/data/repos /app/data/fossil-home

# Expose HTTP port
EXPOSE 8731

# Data persistence volume
VOLUME ["/app/data"]

ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["erl", "-config", "config/sys.config", "-pa", "_build/default/lib/*/ebin", "-eval", "application:ensure_all_started(nemoptera)", "-noshell"]

Clone

You can clone this repository with the following command:

fossil clone https://hgrc.dev/IaaS/Nemoptera Nemoptera.fossil

Contribute

The best way to contribute is through e-mail. See the project documentation for more details.