Skip to content

Commit

Permalink
Publish docker image (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
sameeul authored Dec 19, 2024
1 parent 0de7798 commit 62559d3
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish_rest_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish REST API Docker

on:
workflow_dispatch:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-dev[0-9]+

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout 🛎️
uses: actions/checkout@v2

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

- name: Get Tag
run: echo "tag=${{ github.ref_name }}" >> $GITHUB_ENV

- name: Print Tag
run: echo "Publishing with tag ${{ env.tag }}"

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Publish Sophios Container 🐳
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile_ubuntu_REST
push: true
tags: polusai/sophios-rest-api:${{ env.tag }}

6 changes: 3 additions & 3 deletions docker/Dockerfile_ubuntu_REST
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ RUN apt update && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists/*

COPY . /workflow-inference-compiler
WORKDIR /workflow-inference-compiler
COPY . /sophios
WORKDIR /sophios

RUN pip3 install /workflow-inference-compiler --no-cache-dir
RUN pip3 install /sophios --no-cache-dir

# Then run the sophios REST API through port 3000
EXPOSE 3000
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '0.0.1'
version: '0.2.1'
services:
fastapi-app:
image: vjaganat90/sophios-rest-api:0.0.1
image: polusai/sophios-rest-api:0.2.1
ports:
- "3000:3000"
environment:
Expand Down

0 comments on commit 62559d3

Please sign in to comment.