From 0f32e36dc731a42265775031e4abc5f2037578d5 Mon Sep 17 00:00:00 2001 From: Tobias Palmer Date: Sat, 25 Jul 2020 22:11:43 +0200 Subject: [PATCH] docker hub --- .docker/nginx.conf | 14 ++++++++++++++ .dockerignore | 5 +++++ .github/workflows/docker-hub.yml | 19 +++++++++++++++++++ Dockerfile | 15 +++++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 .docker/nginx.conf create mode 100644 .dockerignore create mode 100644 .github/workflows/docker-hub.yml create mode 100644 Dockerfile diff --git a/.docker/nginx.conf b/.docker/nginx.conf new file mode 100644 index 00000000..dae42626 --- /dev/null +++ b/.docker/nginx.conf @@ -0,0 +1,14 @@ +events{} + +http { + include /etc/nginx/mime.types; + server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + index index.html; + location / { + try_files $uri $uri/ /index.html; + } + } +} \ No newline at end of file diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..3a94d781 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +npm-debug.log +dist +desktop-app/dist +desktop-app/build \ No newline at end of file diff --git a/.github/workflows/docker-hub.yml b/.github/workflows/docker-hub.yml new file mode 100644 index 00000000..62dac699 --- /dev/null +++ b/.github/workflows/docker-hub.yml @@ -0,0 +1,19 @@ +name: Release Drafter + +on: + push: + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build and push Docker images + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: nault/nault + tag_with_ref: true diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f96b77ee --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# build the angular app +FROM node:12 AS build +WORKDIR /usr/src/app +RUN apt-get update && apt-get install -y \ + libudev-dev \ + libusb-1.0-0-dev +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run wallet:build + +# build the nginx hosting container +FROM nginx:1.19-alpine +COPY .docker/nginx.conf /etc/nginx/nginx.conf +COPY --from=build /usr/src/app/dist /usr/share/nginx/html \ No newline at end of file