From 39660769ac3cb8b5156a2c1afeaf29b6b2398c80 Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Fri, 6 Jan 2023 18:38:40 +0530 Subject: [PATCH] Adding Github actions with dev tag --- .github/workflows/build-publish-dev.yml | 28 +++++++++++++++++ dev_Dockerfile | 42 +++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 .github/workflows/build-publish-dev.yml create mode 100644 dev_Dockerfile diff --git a/.github/workflows/build-publish-dev.yml b/.github/workflows/build-publish-dev.yml new file mode 100644 index 0000000..4e3dba8 --- /dev/null +++ b/.github/workflows/build-publish-dev.yml @@ -0,0 +1,28 @@ + +name: Docker Image CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + build: + + runs-on: self-hosted + + steps: + - uses: actions/checkout@v2 + - name: docker login + env: + DOCKER_USER: ${{secrets.DOCKER_HUB_USERNAME}} + DOCKER_PASSWORD: ${{secrets.DOCKER_HUB_PASS}} + run: | + docker login -u $DOCKER_USER -p $DOCKER_PASSWORD + - name: Build the Docker image + run: docker build . --file dev_Dockerfile --tag ranchimallfze/flosight:dev + + - name: Docker Push + run: docker push ranchimallfze/flosight:dev diff --git a/dev_Dockerfile b/dev_Dockerfile new file mode 100644 index 0000000..ae7c295 --- /dev/null +++ b/dev_Dockerfile @@ -0,0 +1,42 @@ +FROM node:10-stretch-slim + +# Install Dependencies +RUN apt-get update && \ + apt-get install --no-install-recommends -y build-essential git libzmq3-dev python nginx curl && \ + rm -rf /var/lib/apt/lists/* +RUN apt-get update +RUN apt-get install ca-certificates -y +RUN update-ca-certificates + +# Install flosight +WORKDIR /flosight +ADD https://api.github.com/repos/ranchimall/flocore-node/git/refs/heads/master flocore-node-version.json +RUN git clone -b dev https://github.com/ranchimall/flocore-node +ADD https://api.github.com/repos/oipwg/flosight-ui/git/refs/heads/master flosight-ui-version.json +ADD https://api.github.com/repos/oipwg/flosight-api/git/refs/heads/master flosight-api-version.json +RUN npm install ./flocore-node/ +RUN npm install flosight-ui flosight-api node-fetch@2 + +# Setup Nginx +RUN service nginx stop && rm /etc/nginx/nginx.conf +WORKDIR /etc/nginx +COPY nginx.conf . +RUN service nginx start + +WORKDIR /nginx +COPY http-proxy.conf . + +# Add flosight configs +WORKDIR /flosight +COPY start.sh . +COPY flocore-node.json . +COPY healthcheck.js . + +RUN mkdir /data +RUN chmod 755 /flosight/start.sh + +# Expose used ports +EXPOSE 80 443 3001 7312 7313 17312 17313 17413 41289 + +HEALTHCHECK CMD node healthcheck.js +CMD ["/flosight/start.sh"] \ No newline at end of file