diff --git a/.gitignore b/.gitignore
index 9282e3123..8bdd34dd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,7 +33,3 @@ npm-debug.log
 
 # The built Escript
 /livebook
-
-# We generate priv when building release or escript
-/priv/static
-/priv/iframe_static
diff --git a/Dockerfile b/Dockerfile
index 117415d8f..522e74656 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -57,7 +57,6 @@ COPY config config
 RUN mix do deps.get, deps.compile
 
 # Compile and build the release
-COPY priv/.gitkeep priv/.gitkeep
 COPY rel rel
 COPY static static
 COPY iframe/priv/static/iframe iframe/priv/static/iframe
diff --git a/lib/mix/tasks/livebook.gen_priv.ex b/lib/mix/tasks/livebook.gen_priv.ex
index 5b995caff..162caa88c 100644
--- a/lib/mix/tasks/livebook.gen_priv.ex
+++ b/lib/mix/tasks/livebook.gen_priv.ex
@@ -1,18 +1,16 @@
 defmodule Mix.Tasks.Livebook.GenPriv do
   @moduledoc false
 
-  # Note that we need to include priv/.gitkeep in Dockerfile and Hex
-  # package files, so that priv/ is symlinked within _build/, before
-  # we generate the actual files.
-
   use Mix.Task
 
   @gzippable_exts ~w(.js .css .txt .text .html .json .svg .eot .ttf)
 
   @impl true
   def run([]) do
-    compress_and_copy("static", "priv/static")
-    compress_and_copy("iframe/priv/static/iframe", "priv/iframe_static")
+    app_path = Mix.Project.app_path()
+
+    compress_and_copy("static", Path.join(app_path, "priv/static"))
+    compress_and_copy("iframe/priv/static/iframe", Path.join(app_path, "priv/iframe_static"))
   end
 
   defp compress_and_copy(source_dir, target_dir) do
diff --git a/mix.exs b/mix.exs
index 1a9090d85..935e47556 100644
--- a/mix.exs
+++ b/mix.exs
@@ -59,7 +59,7 @@ defmodule Livebook.MixProject do
         "GitHub" => "https://github.com/livebook-dev/livebook"
       },
       files:
-        ~w(lib static priv/.gitkeep config mix.exs mix.lock README.md LICENSE CHANGELOG.md iframe/priv/static/iframe proto/lib)
+        ~w(lib static config mix.exs mix.lock README.md LICENSE CHANGELOG.md iframe/priv/static/iframe proto/lib)
     ]
   end
 
diff --git a/priv/.gitkeep b/priv/.gitkeep
deleted file mode 100644
index e69de29bb..000000000