From b4b9d42bf418b05bcec3eab2344fc90263c6376e Mon Sep 17 00:00:00 2001 From: Nils Jakobi Date: Sat, 23 Nov 2019 00:17:15 +0100 Subject: [PATCH] test for multistage build --- .drone.yml | 39 +++++++-------------------------------- Dockerfile | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 32 deletions(-) create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml index 40bc9f4..9170d60 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,37 +1,12 @@ kind: pipeline name: meshviewer build -clone: - depth: 50 - steps: -# - name: clone git -# image: docker:git -# commands: -# - git submodule update --recursive --init - -- name: build on node 12 - image: node:12.12.0-stretch - commands: - - node --version - - npm --version - - yarn --version - - pwd - - ls -alh - - npm i gulp-cli -g - - yarn - - gulp - -# - name: backup-old-firmware -# image: appleboy/drone-ssh -# settings: -# host: 46.4.138.183 -# username: fwupload -# key: -# from_secret: ssh-update -# port: 22 -# command_timeout: 120m -# script: -# - ./rsync-backup.sh -# - rm -rf /srv/fwuploads/troisdorf/* +- name: docker + image: plugins/docker + settings: + repo: fftdf/meshviewer + target: meshviewer + username: from_secret: docker_username + password: from_secret: docker_password diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1d54901 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# builder +FROM node:12.12.0-stretch as builder + +# show versions +RUN node --version && npm --version && yarn --version + +# install gulp +RUN npm i gulp-cli -g + +# run yarn for prerequisits +RUN yarn + +# run gulp to build app +RUN gulp + + +# build docker container +FROM nginx:1.17.6-alpine as meshviewer +COPY --from=builder /drone/src/build /usr/share/nginx/html/