Created
August 15, 2019 16:44
-
-
Save dpkirchner/a12bdbd1e2b37f350577a27ced7ef527 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_modules | |
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:12-alpine | |
ARG dev | |
EXPOSE 8080 | |
ENV PORT=8080 | |
ENV DEV="$dev" | |
WORKDIR /app | |
# Download the dependencies | |
COPY package*.json /app/ | |
RUN [[ "$dev" == 1 ]] && npm install || npm install --production | |
# Install the app files | |
COPY . . | |
# Build the app | |
RUN npm build | |
# Start the app | |
CMD ["npm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"imageName": "name-of-app", | |
"imageRegistry": "docker-registry.wint.livelyvideo.tv/", | |
... | |
"scripts": { | |
... | |
"docker:build:release": "docker build -t ${npm_package_imageRegistry}${npm_package_imageName}:${npm_package_version} .", | |
"docker:push:release": "docker push ${npm_package_imageRegistry}${npm_package_imageName}:${npm_package_version}", | |
"docker:build:dev": "docker build -t ${npm_package_imageRegistry}${npm_package_imageName}:${npm_package_version}-dev --build-arg dev=1 ..", | |
"docker:push:dev": "docker push ${npm_package_imageRegistry}${npm_package_imageName}:${npm_package_version}-dev", | |
"docker:test:dev": "npm run docker:build:dev && docker run --rm --entrypoint npm ${npm_package_imageRegistry}${npm_package_imageName}:${npm_package_version}-dev run test", | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment