Skip to content

Build your personal knowledge base with Trilium Notes

added docker build, closes #106

azivner4c8eeb2e6f27
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000000..89938ab06d
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,4 @@
+node_modules
+npm-debug.log
+dist
+.idea
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000..9b40d32a10
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,21 @@
+FROM node:8.11.2
+
+RUN apt-get update && apt-get install -y nasm
+
+# Create app directory
+WORKDIR /usr/src/app
+
+# Install app dependencies
+# A wildcard is used to ensure both package.json AND package-lock.json are copied
+# where available (npm@5+)
+COPY package*.json ./
+
+RUN npm install --production
+# If you are building your code for production
+# RUN npm install --only=production
+
+# Bundle app source
+COPY . .
+
+EXPOSE 8080
+CMD [ "node", "src/www" ]
diff --git a/bin/build-docker.sh b/bin/build-docker.sh
new file mode 100755
index 0000000000..072286b29b
--- /dev/null
+++ b/bin/build-docker.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+if [[ $# -eq 0 ]] ; then
+ echo "Missing argument of new version"
+ exit 1
+fi
+
+docker build -t zadam/trilium:latest -t zadam/trilium:$1 .
\ No newline at end of file
diff --git a/bin/push-docker-image.sh b/bin/push-docker-image.sh
new file mode 100644
index 0000000000..d8bf4d593b
--- /dev/null
+++ b/bin/push-docker-image.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+if [[ $# -eq 0 ]] ; then
+ echo "Missing argument of new version"
+ exit 1
+fi
+
+docker push zadam/trilium:latest
+docker push zadam/trilium:$1
\ No newline at end of file
diff --git a/bin/release.sh b/bin/release.sh
index 0967443eab..a50ba2a6b4 100755
--- a/bin/release.sh
+++ b/bin/release.sh
@@ -75,4 +75,8 @@ github-release upload \
--name "$WINDOWS_X64_BUILD" \
--file "dist/$WINDOWS_X64_BUILD"
+bin/build-docker.sh $VERSION
+
+bin/push-docker-image.sh $VERSION
+
echo "Release finished!"
\ No newline at end of file