Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .daemonless/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# dbuild configuration file
# Full reference: https://github.com/daemonless/dbuild

icon: ':simple-apachecouchdb:'

build:
architectures:
- amd64
- aarch64
variants:
- tag: pkg
containerfile: Containerfile.pkg
aliases: ["latest"]
default: true
- tag: pkg-latest
containerfile: Containerfile.pkg
args:
BASE_VERSION: "15.1-latest"

cit:
mode: health
port: 5984
health: /_up
ready: "Apache CouchDB has started"
1 change: 1 addition & 0 deletions .daemonless/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build FreeBSD Container

on:
push:
branches: [main]
paths-ignore: ['*.md', 'LICENSE', '.gitignore']
pull_request:
branches: [main]
workflow_dispatch:
inputs:
variant:
description: 'Tag to rebuild (blank = all)'
required: false
type: string

permissions:
contents: write
packages: write
id-token: write
actions: read

jobs:
build:
uses: daemonless/workflows/.github/workflows/daemonless-build.yaml@v1
with:
image_name: couchdb
variant: ${{ inputs.variant }}
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scripts/
56 changes: 56 additions & 0 deletions Containerfile.pkg
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# --------------------------------------------------------------------------
# THIS FILE IS AUTOGENERATED - DO NOT EDIT MANUALLY
#
# Source: Containerfile.pkg.j2
# --------------------------------------------------------------------------

ARG BASE_VERSION=15.1
FROM ghcr.io/daemonless/base-exec:${BASE_VERSION}

ARG FREEBSD_ARCH=amd64
ARG PKG_NAME="couchdb3"
ARG PACKAGES="${PKG_NAME} ca_root_nss"
ARG HEALTHCHECK_ENDPOINT="http://127.0.0.1:5984/_up"

ENV HEALTHCHECK_URL="${HEALTHCHECK_ENDPOINT}"

LABEL org.opencontainers.image.title="CouchDB" \
org.opencontainers.image.description="Seamless multi-primary syncing JSON document database with an HTTP API, MapReduce views, and Couch Replication Protocol support." \
org.opencontainers.image.source="https://github.com/daemonless/couchdb" \
org.opencontainers.image.url="https://couchdb.apache.org/" \
org.opencontainers.image.documentation="https://docs.couchdb.org/" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="Databases" \
io.daemonless.port="5984" \
io.daemonless.volumes="/config" \
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.pkg-source="pkg" \
io.daemonless.packages="${PACKAGES}" \
io.daemonless.pkg-name="${PKG_NAME}" \
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}"

# Install Apache CouchDB from FreeBSD packages
RUN pkg update && \
pkg install -y ${PACKAGES} && \
mkdir -p /app /config/data /config/etc/local.d \
/usr/local/libexec/couchdb3/etc/default.d && \
pkg query '%v' ${PKG_NAME} > /app/version && \
ln -sf /usr/local/libexec/couchdb3/bin/couchdb /usr/local/bin/couchdb && \
ln -sf /usr/local/libexec/couchdb3/bin/remsh /usr/local/bin/remsh && \
ln -sf /usr/local/libexec/couchdb3/bin/weatherreport /usr/local/bin/weatherreport && \
chmod -R a+rX /usr/local/etc/couchdb3 && \
chown -R bsd:bsd /config && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*

COPY root/ /
RUN chmod +x /daemonless/libexec/couchdb

WORKDIR /config
CMD ["/daemonless/libexec/couchdb"]

# 5984: HTTP API and Fauxton UI; 4369: epmd; 9100: Erlang cluster distribution
EXPOSE 5984 4369 9100
VOLUME /config
54 changes: 54 additions & 0 deletions Containerfile.pkg.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
ARG BASE_VERSION=15.1
FROM ghcr.io/daemonless/base-exec:${BASE_VERSION}

ARG FREEBSD_ARCH=amd64
ARG PKG_NAME="couchdb3"
ARG PACKAGES="${PKG_NAME} ca_root_nss"
ARG HEALTHCHECK_ENDPOINT="http://127.0.0.1:5984/_up"

ENV HEALTHCHECK_URL="${HEALTHCHECK_ENDPOINT}"

LABEL org.opencontainers.image.title="{{ title }}" \
org.opencontainers.image.description="{{ description }}" \
org.opencontainers.image.source="{{ repo_url }}" \
org.opencontainers.image.url="{{ web_url }}" \
org.opencontainers.image.documentation="https://docs.couchdb.org/" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.vendor="daemonless" \
org.opencontainers.image.authors="daemonless" \
io.daemonless.category="{{ category }}" \
{%- if ports %}
io.daemonless.port="{{ ports[0].port }}" \
{%- endif %}
{%- if volumes %}
io.daemonless.volumes="{{ volumes | map(attribute='path') | join(',') }}" \
{%- endif %}
io.daemonless.arch="${FREEBSD_ARCH}" \
io.daemonless.pkg-source="pkg" \
io.daemonless.packages="${PACKAGES}" \
io.daemonless.pkg-name="${PKG_NAME}" \
io.daemonless.healthcheck-url="${HEALTHCHECK_ENDPOINT}"

# Install Apache CouchDB from FreeBSD packages
RUN pkg update && \
pkg install -y ${PACKAGES} && \
mkdir -p /app /config/data /config/etc/local.d \
/usr/local/libexec/couchdb3/etc/default.d && \
pkg query '%v' ${PKG_NAME} > /app/version && \
ln -sf /usr/local/libexec/couchdb3/bin/couchdb /usr/local/bin/couchdb && \
ln -sf /usr/local/libexec/couchdb3/bin/remsh /usr/local/bin/remsh && \
ln -sf /usr/local/libexec/couchdb3/bin/weatherreport /usr/local/bin/weatherreport && \
chmod -R a+rX /usr/local/etc/couchdb3 && \
chown -R bsd:bsd /config && \
pkg clean -ay && \
rm -rf /var/cache/pkg/* /var/db/pkg/repos/*

COPY root/ /
RUN chmod +x /daemonless/libexec/couchdb

WORKDIR /config
CMD ["/daemonless/libexec/couchdb"]

# 5984: HTTP API and Fauxton UI; 4369: epmd; 9100: Erlang cluster distribution
EXPOSE 5984 4369 9100
VOLUME /config
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
BSD 2-Clause License

Copyright (c) 2026, daemonless contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading
Loading