Deno docker update (#174)

Fix #150: update Dockerfile and docker-compose
This commit is contained in:
Zef Hemel
2022-12-07 18:43:47 +01:00
committed by GitHub
parent acec440444
commit 5b8c25f8b3
8 changed files with 109 additions and 27 deletions
+21 -7
View File
@@ -1,12 +1,26 @@
FROM node:18.6.0-slim
FROM denoland/deno:alpine-1.28.3
RUN mkdir /space
RUN chown node:node /space
USER node
WORKDIR /space
# 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
RUN npx --yes @silverbulletmd/server || true
# Copy the bundled version of silverbullet into the container
ADD ./dist/silverbullet.js /silverbullet.js
# Make sure the deno user has access to the space volume
RUN mkdir -p /space
RUN chown -R deno:deno /space
# deno user id is 1000 in alpine image
USER deno
# Expose port 3000
# Port map this when running, e.g. with -p 3002:3000 (where 3002 is the host port)
EXPOSE 3000
CMD ["sh","-c","npx --yes @silverbulletmd/server --port 3000 /space"]
# 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", "--", "deno", "run", "-A", "--unstable", "/silverbullet.js", "/space"]