diff --git a/Dockerfile b/Dockerfile
index 1bd12ddd6139bd66fb5791fc7aea1117f56a33dc..2f4643b962ab9dba868cb0e23d5696b60511434d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -16,9 +16,10 @@ COPY server.js /home/theia/src-gen/backend/server.js
 COPY start.sh .
 
 COPY recorder-out/dist/main.js deadlock/recorder.js
+COPY recorder-out/dist/preStop.js deadlock/preStop.js
 COPY .gitignore_recorder deadlock/.gitignore
 
 RUN chmod 500 deadlock/ -R
 RUN chmod 500 start.sh
 
-ENTRYPOINT ["bash", "start.sh"]
\ No newline at end of file
+ENTRYPOINT ["bash", "start.sh"]
diff --git a/recorder-out/webpack.config.js b/recorder-out/webpack.config.js
index f0e0d44599b0aba4f08e50ace4233d4bc1a3849c..38742fc4813d9f32b86f3ab5d3342120952513dd 100644
--- a/recorder-out/webpack.config.js
+++ b/recorder-out/webpack.config.js
@@ -2,10 +2,13 @@ const path = require('path');
 const TerserPlugin = require("terser-webpack-plugin");
 
 module.exports = {
-  entry: './recorder/index.js',
+  entry: {
+    main: './recorder/index.js',
+    preStop: './recorder/preStop.js',
+  },
   target: 'node',
   output: {
-    filename: 'main.js',
+    filename: '[name].js',
     path: path.resolve(__dirname, 'dist'),
   },
   optimization: {