From 9d4c1c6e1a4bb9f1bd1b63bfda6df0146699f90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Tue, 15 Jan 2019 01:35:09 +0100 Subject: [PATCH] CMD and EXPOSE is valid for all docker stages FYI: @mattwr18 and @ksinkar I wanted to test cypress with the Travis configuration. I had to add `command: ...` to the `docker-compose.travis.yml` which I find quite annoying. So I put CMD and EXPOSE at the top of the Dockerfile, thus making it a default for all stages including build-and-test. --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7a8c6583c..abbf2917b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM node:10-alpine as base LABEL Description="Web Frontend of the Social Network Human-Connection.org" Vendor="Human-Connection gGmbH" Version="0.0.1" Maintainer="Human-Connection gGmbH (developer@human-connection.org)" +EXPOSE 3000 +CMD ["yarn", "run", "start"] + # Expose the app port ARG BUILD_COMMIT ENV BUILD_COMMIT=$BUILD_COMMIT @@ -25,6 +28,3 @@ FROM base as production ENV NODE_ENV=production COPY --from=build-and-test ./nitro-web/node_modules ./node_modules COPY --from=build-and-test ./nitro-web/.nuxt ./.nuxt - -EXPOSE 3000 -CMD ["yarn", "run", "start"]