diff --git a/Dockerfile b/Dockerfile
index bf50d51e9176cfe509d42cfc629eb6578dea5aae..1fd4cbb324f42076c61d7d4bc568aae97a870298 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -37,6 +37,10 @@ USER 1001:1001
 
 COPY --from=0 /go/bin/dex /usr/local/bin/dex
 
+# Copy module dependencies for CVE scanning / dependency analysis.
+COPY go.mod go.sum                 /opt/dex/dependencies/
+COPY api/v2/go.mod api/v2/go.sum   /opt/dex/dependencies/api/v2/
+
 # Import frontend assets and set the correct CWD directory so the assets
 # are in the default path.
 COPY web web