silverbullet/Dockerfile

30 lines
973 B
Docker
Raw Normal View History

FROM frolvlad/alpine-glibc:alpine-3.17
RUN apk add tini
RUN adduser -D -H -u 1000 silverbullet
2022-07-18 09:23:27 +08:00
# The volume that will keep the space data
# Create a volume first:
# docker volume create myspace
# Then bind-mount it when running the container with the -v flag, e.g.:
# docker run -v myspace:/space -it zefhemel/silverbullet
VOLUME /space
2022-07-18 09:23:27 +08:00
# Copy the bundled version of silverbullet into the container
ADD ./bin/silverbullet /silverbullet
2022-07-19 01:48:19 +08:00
# Make sure the deno user has access to the space volume
RUN mkdir -p /space
RUN chown -R silverbullet /space
# deno user id is 1000 in alpine image
#USER silverbullet
# 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
# 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
ENTRYPOINT ["tini", "--", "/silverbullet", "--hostname", "0.0.0.0", "/space"]