Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3284506
D4175.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4175.diff
View Options
diff --git a/keyserver/Dockerfile b/keyserver/Dockerfile
--- a/keyserver/Dockerfile
+++ b/keyserver/Dockerfile
@@ -39,29 +39,37 @@
RUN yarn cleaninstall
#-------------------------------------------------------------------------------
-# STEP 2: COPY IN SOURCE FILES
+# STEP 2: WEBPACK BUILD
+# We do this first so Docker doesn't rebuild when only keyserver files change
+#-------------------------------------------------------------------------------
+
+COPY lib lib/
+COPY landing landing/
+RUN yarn workspace landing prod
+
+COPY web web/
+RUN yarn workspace web prod
+
+#-------------------------------------------------------------------------------
+# STEP 3: COPY IN SOURCE FILES
# We run this later so the above layers are cached if only source files change
#-------------------------------------------------------------------------------
COPY . .
#-------------------------------------------------------------------------------
-# STEP 3: RUN BUILD SCRIPTS
+# STEP 4: RUN BUILD SCRIPTS
# We need to populate keyserver/dist, among other things
#-------------------------------------------------------------------------------
-# Webpack builds
-RUN yarn workspace web prod
-RUN yarn workspace landing prod
-
# Babel transpilation of keyserver src
-WORKDIR /app/keyserver
-RUN yarn prod-build
+RUN yarn workspace keyserver prod-build
#-------------------------------------------------------------------------------
-# STEP 4: RUN THE SERVER
+# STEP 5: RUN THE SERVER
# Actually run the Node.js keyserver using nvm
#-------------------------------------------------------------------------------
EXPOSE 3000
+WORKDIR /app/keyserver
CMD bash/run-prod.sh
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 12:11 PM (19 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2524188
Default Alt Text
D4175.diff (1 KB)
Attached To
Mode
D4175: [keyserver] Cache Webpack builds in Docker build
Attached
Detach File
Event Timeline
Log In to Comment