You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/10/31 10:03:25 UTC

[GitHub] [superset] benjaminrene commented on a diff in pull request #21954: build: Mutli-stage build and slim image for websocket container

benjaminrene commented on code in PR #21954:
URL: https://github.com/apache/superset/pull/21954#discussion_r1009234507


##########
superset-websocket/Dockerfile:
##########
@@ -12,13 +12,28 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-FROM node:16
+FROM node:16-alpine as build
 
 WORKDIR /home/superset-websocket
 
-COPY . .
+COPY . ./
 
-RUN npm ci
-RUN npm run build
+RUN npm ci && \
+  npm run build
 
-CMD ["npm", "start"]
+
+FROM node:16-alpine
+
+ENV NODE_ENV=production
+WORKDIR /home/superset-websocket
+
+COPY --from=build /home/superset-websocket/dist ./dist
+COPY package*.json ./
+
+# Only install production dependencies
+RUN npm install --omit=dev

Review Comment:
   Not sure this is required since you run `npm ci` and `npm run build` from build container. I think you should copy `node_modules` directory as well to the runtime container instead of running npm install



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org