Files
cobble/Dockerfile
T
tben 524f0dde36 Show the running version on Settings > General
The General page ends with a Version block naming the release this
server runs, so an update can be confirmed from the app.

The version is COBBLE_VERSION, the release tag the image was built with
(Dockerfile ARG, passed by the release workflow, which falls back to
package.json's version on a workflow-dispatch build), else package.json's
version, which a development server reports too, with (development)
after it. runningVersion (src/utils/running-version.ts) drops an
unusable version string rather than showing it.

Also includes the working tree's pending signup guard in
src/pages/__root.server.ts: a user who still holds a session while the
install has no users is sent to /auth/logout (and may load it).
2026-10-22 16:03:56 +01:00

44 lines
1.4 KiB
Docker

FROM oven/bun:1.4.3-debian
LABEL org.opencontainers.image.title="Cobble" \
org.opencontainers.image.description="A self-hosted crew of small AI worker bots." \
org.opencontainers.image.source="https://github.com/Moduletrace/cobble" \
org.opencontainers.image.licenses="MIT"
# The app serves plain HTTP; HTTPS is the reverse proxy's job.
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl bash nano wget zip unzip tar gzip \
&& rm -rf /var/lib/apt/lists/*
ENV NODE_ENV=production
# Everything that must survive an update lives on the /data volume:
# the database, media, computers' home directories
ENV DATA_DIR=/data
ENV DB_DIR=/data/db
ENV BUN_FEATURE_FLAG_DISABLE_STREAMING_INSTALL=1
# The release's version, which Settings > General shows. The release
# workflow passes the published tag; a local build leaves it empty and
# the app falls back to `package.json`'s version.
ARG COBBLE_VERSION=
ENV COBBLE_VERSION=$COBBLE_VERSION
WORKDIR /app
RUN echo 'alias ll="ls -laF"' >/root/.bashrc
COPY package.json bun.lock ./
# Local packages the lockfile installs from (`file:` dependencies)
COPY packages ./packages
RUN bun install --frozen-lockfile
COPY . /app/.
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD curl -fsS "http://localhost:${PORT:-7227}/api/health" || exit 1
ENTRYPOINT ["/entrypoint.sh"]