Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into nishauriV2
  • Loading branch information
Ronald-pro committed Mar 8, 2024
2 parents fabf7bc + b30ce66 commit be0a281
Show file tree
Hide file tree
Showing 5 changed files with 3,984 additions and 4,893 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cicd_process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ jobs:
# Build and run Docker container
docker stop ushauri_api || true
docker rm ushauri_api || true
docker build -t ushauri_api:latest "$deploy_dir"
docker build --no-cache -t ushauri_api:latest "$deploy_dir"
docker run -p 7002:5000 --name ushauri_api -d --restart always ushauri_api:latest
62 changes: 62 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Push Docker Image to Docker Hub

on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build -t ushauri_api:latest .
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test the Docker image
run: docker run -p 7002:5000 --name ushauri_api -d --restart always ushauri_api:latest
push_to_registry:
needs: build
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: "{{defaultContext}}"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16
FROM node:18

WORKDIR /app

Expand All @@ -7,8 +7,8 @@ COPY package*.json ./
RUN npm install

# Install Python and pip, install Python dependencies using pip, and clean up
RUN apt-get update && apt-get install -y python3 python3-pip && \
pip3 install gradio_client python-shell && \
RUN apt-get update && apt-get install -y python3-pip && \
pip3 install gradio_client python-shell --break-system-packages && \
apt-get clean

# Copy your Node.js application code to the working directory
Expand Down
Loading

0 comments on commit be0a281

Please sign in to comment.