Skip to content

Commit

Permalink
Add pipleine to build and push
Browse files Browse the repository at this point in the history
  • Loading branch information
BanulaKumarage committed Feb 5, 2024
1 parent 3ecd3a3 commit 671a020
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Git
.git
.gitignore
.gitattributes

# Docker
docker-compose.yml
Dockerfile
.docker
.dockerignore

# vscode
.vscode/

# Byte-compiled / optimized / DLL files
**/__pycache__/
**/*.py[cod]

# DB folders
data/
face-groups/
mongo-data/
qdrant-data/
29 changes: 29 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Docker Container

on:
push:
branches:
- dockerizing

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: image/
push: true
tags: ghcr.io/${{ github.repository }}/backend:${{ github.sha }}
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM condaforge/mambaforge:23.3.1-0

# Set the working directory in the container
WORKDIR /app

# Install dependencies
RUN mamba create -n picssmart transformers python=3.10 pytorch fairscale dask-mongo torchaudio pytorch-cuda=11.7 iopath cudatoolkit=11.7 -c pytorch -c nvidia -c iopath -c conda-forge -y
SHELL ["/bin/bash", "-c"]
RUN conda init bash && source ~/.bashrc
RUN conda activate picssmart
RUN mamba install rapids=23.02 -c rapidsai -c conda-forge -c nvidia -y
RUN pip install "fastapi[all]" pillow pillow-heif einops pycocoevalcap cryptography==38.0.4 motor pymongo pyyaml networkx omegaconf timm decord opencv-python webdataset jupyterlab torchvision
RUN pip install tensorflow
RUN pip install gdown
RUN pip install spacy
RUN pip install insightface
RUN pip install onnxruntime
RUN pip install uvicorn
RUN pip install flwr
RUN pip install qdrant-client

# Copy the rest of the application code into the container
COPY . .

# Expose the port that your app runs on
EXPOSE 8000

# Command to run the application
CMD ["uvicorn", "server.__main__:create_app", "--factory", "--reload"]

0 comments on commit 671a020

Please sign in to comment.