Skip to content

Build your personal knowledge base with Trilium Notes

docker: Fix build by generating artifacts

Elian Dorand18bfb9d69be
diff --git a/.dockerignore b/.dockerignore
index 6c3840719b..941905c66f 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -5,3 +5,5 @@
/docs
/npm-debug.log
node_modules
+
+src/**/*.ts
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 89bda67417..78429488a4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,6 +21,10 @@ COPY . .
COPY server-package.json package.json
+# Copy TypeScript build artifacts into the original directory structure.
+RUN ls
+RUN cp -R build/src/* src/.
+
# Install app dependencies
RUN set -x \
&& npm install \
diff --git a/bin/build-docker.sh b/bin/build-docker.sh
index c77850ebad..2b37946777 100755
--- a/bin/build-docker.sh
+++ b/bin/build-docker.sh
@@ -5,6 +5,9 @@ SERIES=${VERSION:0:4}-latest
cat package.json | grep -v electron > server-package.json
+echo "Compiling typescript..."
+npx tsc
+
sudo docker build -t zadam/trilium:$VERSION --network host -t zadam/trilium:$SERIES .
if [[ $VERSION != *"beta"* ]]; then
diff --git a/tsconfig.json b/tsconfig.json
index bf97f7be23..293c66f7cf 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,8 +13,7 @@
},
"include": [
"./src/**/*.js",
- "./src/**/*.ts",
- "./*.ts"
+ "./src/**/*.ts"
],
"exclude": ["./node_modules/**/*"],
"ts-node": {
diff --git a/webpack.config.js b/webpack.config.js
index 2e3bd7b17c..41077c00e5 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -4,7 +4,7 @@ const assetPath = require('./src/services/asset_path');
module.exports = {
mode: 'production',
entry: {
- setup: './src/public/app/setup.ts',
+ setup: './src/public/app/setup.js',
mobile: './src/public/app/mobile.js',
desktop: './src/public/app/desktop.js',
},