Adding Github actions with dev tag

This commit is contained in:
Vivek Teega 2023-01-06 18:38:40 +05:30
parent c06e7759b0
commit 39660769ac
2 changed files with 70 additions and 0 deletions

28
.github/workflows/build-publish-dev.yml vendored Normal file
View File

@ -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

42
dev_Dockerfile Normal file
View File

@ -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"]