2024-01-15 15:46:37 +00:00
|
|
|
FROM lukechannings/deno:v1.39.4
|
2022-12-07 17:43:47 +00:00
|
|
|
# The volume that will keep the space data
|
2023-11-27 14:44:39 +00:00
|
|
|
|
|
|
|
# Either create a volume:
|
2022-12-07 17:43:47 +00:00
|
|
|
# docker volume create myspace
|
|
|
|
# Then bind-mount it when running the container with the -v flag, e.g.:
|
2023-05-23 18:53:53 +00:00
|
|
|
# docker run -v myspace:/space -p3000:3000 -it zefhemel/silverbullet
|
2023-11-27 14:44:39 +00:00
|
|
|
# Or simply mount an existing folder into the container:
|
|
|
|
# docker run -v /path/to/my/folder:/space -p3000:3000 -it zefhemel/silverbullet
|
2022-12-07 17:43:47 +00:00
|
|
|
VOLUME /space
|
2022-07-18 01:23:27 +00:00
|
|
|
|
2023-05-09 13:31:40 +00: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-18 17:48:19 +00:00
|
|
|
|
2022-12-07 17:43:47 +00:00
|
|
|
# Make sure the deno user has access to the space volume
|
2023-12-18 16:18:58 +00:00
|
|
|
RUN mkdir -p -m 777 /space \
|
2023-05-23 18:53:53 +00:00
|
|
|
&& chmod +x /tini \
|
2023-07-02 09:25:32 +00:00
|
|
|
&& apt update \
|
2023-09-04 18:42:56 +00:00
|
|
|
&& apt install -y git ssh-client \
|
2023-05-23 18:53:53 +00:00
|
|
|
&& echo "**** cleanup ****" \
|
|
|
|
&& apt-get -y autoremove \
|
|
|
|
&& apt-get clean \
|
2023-11-29 12:47:18 +00:00
|
|
|
&& mkdir -p /deno-dir \
|
|
|
|
&& chmod 777 /deno-dir \
|
2023-05-23 18:53:53 +00:00
|
|
|
&& rm -rf \
|
2023-05-09 13:31:40 +00:00
|
|
|
/tmp/* \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/var/tmp/* \
|
|
|
|
/var/log/* \
|
|
|
|
/usr/share/man
|
2022-12-07 17:43:47 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Expose port 3000
|
|
|
|
# Port map this when running, e.g. with -p 3002:3000 (where 3002 is the host port)
|
2022-07-18 01:23:27 +00:00
|
|
|
EXPOSE 3000
|
|
|
|
|
2023-11-27 14:44:39 +00:00
|
|
|
# Always binding to this IP, otherwise the server wouldn't be available
|
2023-08-11 18:37:13 +00:00
|
|
|
ENV SB_HOSTNAME 0.0.0.0
|
|
|
|
ENV SB_FOLDER /space
|
|
|
|
|
2023-07-02 09:25:32 +00:00
|
|
|
# Copy the bundled version of silverbullet into the container
|
|
|
|
ADD ./dist/silverbullet.js /silverbullet.js
|
2023-11-27 14:44:39 +00:00
|
|
|
# As well as the docker-entrypoint.sh script
|
2023-11-27 14:01:02 +00:00
|
|
|
ADD ./docker-entrypoint.sh /docker-entrypoint.sh
|
2023-07-02 09:25:32 +00:00
|
|
|
|
2022-12-07 17:43:47 +00:00
|
|
|
# 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 14:01:02 +00:00
|
|
|
ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"]
|