silverbullet/Dockerfile

58 lines
1.8 KiB
Docker
Raw Normal View History

2024-10-10 18:52:28 +08:00
FROM denoland/deno:debian-2.0.0
2024-07-26 02:58:03 +08:00
# The volume that will keep the space data
2023-11-27 22:44:39 +08:00
# 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 zefhemel/silverbullet
2023-11-27 22:44:39 +08:00
# Or simply mount an existing folder into the container:
# docker run -v /path/to/my/folder:/space -p3000:3000 -it zefhemel/silverbullet
2024-07-26 02:58:03 +08:00
VOLUME /space
2022-07-18 09:23:27 +08:00
# Accept TARGETARCH as argument
ARG TARGETARCH
# Adding tini manually, as it's not included anymore in the new baseimage
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TARGETARCH} /tini
2022-07-19 01:48:19 +08:00
# Make sure the deno user has access to the space volume
RUN mkdir -p -m 777 /space \
&& chmod +x /tini \
&& apt update \
2023-09-05 02:42:56 +08:00
&& apt install -y git ssh-client \
&& echo "**** cleanup ****" \
&& apt-get -y autoremove \
&& apt-get clean \
2023-11-29 20:47:18 +08:00
&& mkdir -p /deno-dir \
&& chmod 777 /deno-dir \
&& rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/* \
/var/log/* \
/usr/share/man
# Expose port 3000
# Port map this when running, e.g. with -p 3002:3000 (where 3002 is the host port)
2022-07-18 09:23:27 +08:00
EXPOSE 3000
2023-11-27 22:44:39 +08:00
# Always binding to this IP, otherwise the server wouldn't be available
2023-08-12 02:37:13 +08:00
ENV SB_HOSTNAME 0.0.0.0
ENV SB_FOLDER /space
# Copy the bundled version of silverbullet into the container
ADD ./dist/silverbullet.js /silverbullet.js
2024-10-10 20:04:51 +08:00
# Precache any remaining dependencies
RUN deno cache /silverbullet.js
2023-11-27 22:44:39 +08:00
# As well as the docker-entrypoint.sh script
2023-11-27 22:01:02 +08:00
ADD ./docker-entrypoint.sh /docker-entrypoint.sh
# Run the server, allowing to pass in additional argument at run time, e.g.
# docker run -p 3002:3000 -v myspace:/space -it zefhemel/silverbullet --user me:letmein
2023-11-27 22:01:02 +08:00
ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"]