This gives a false sense of persistence, users need to explicitly mount /space in all cases as is documented.
37 lines
1.3 KiB
Docker
37 lines
1.3 KiB
Docker
FROM alpine:latest
|
|
|
|
ARG TARGETARCH
|
|
|
|
# Either create a volume:
|
|
# docker volume create myspace
|
|
# Then bind-mount it when running the container with the -v flag, e.g.:
|
|
# docker run -v myspace:/space -p3000:3000 -it ghcr.io/silverbulletmd/silverbullet
|
|
# Or simply mount an existing folder into the container:
|
|
# docker run -v /path/to/my/folder:/space -p3000:3000 -it ghcr.io/silverbulletmd/silverbullet
|
|
|
|
RUN apk add --no-cache git curl bash tini libc6-compat
|
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:$SB_PORT$SB_URL_PREFIX/.ping || exit 1
|
|
|
|
# Expose port 3000
|
|
# Port map this when running, e.g. with -p 3002:3000 (where 3002 is the host port)
|
|
EXPOSE 3000
|
|
|
|
# Always binding to this IP, otherwise the server wouldn't be available
|
|
ENV SB_HOSTNAME=0.0.0.0
|
|
ENV SB_FOLDER=/space
|
|
ENV SB_PORT=3000
|
|
|
|
# Reset /etc/group and /etc/passwd
|
|
RUN echo "" > /etc/group && echo "root:x:0:0:root:/root:/bin/sh" > /etc/passwd
|
|
|
|
# As well as the docker-entrypoint.sh script
|
|
ADD ./docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
# Copy the bundled version of silverbullet into the container
|
|
ADD silverbullet-${TARGETARCH} /silverbullet
|
|
|
|
# Run the server, allowing to pass in additional argument at run time, e.g.
|
|
# docker run -p 3002:3000 -v myspace:/space -it ghcr.io/silverbulletmd/silverbullet --user me:letmein
|
|
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]
|