File size: 1,477 Bytes
e2f99d5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Use NVIDIA PyTorch as the base image
FROM nvcr.io/nvidia/pytorch:23.12-py3

# Install additional dependencies
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6

# Set environment variables for Miniconda and Conda environment
ENV CONDA_DIR /opt/conda
ENV PATH $CONDA_DIR/bin:$PATH

# Install Miniconda
RUN apt-get update && apt-get install -y wget && \
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
    bash Miniconda3-latest-Linux-x86_64.sh -b -p $CONDA_DIR && \
    rm Miniconda3-latest-Linux-x86_64.sh

# Create a new Conda environment named "bocr" with Python 3.9
RUN conda create -n bocr python=3.9 -y

# Initialize conda 
RUN conda init

# Reload the env configs
RUN source ~/.bashrc

# Make RUN commands use the bocr environment
SHELL ["conda", "run", "-n", "bocr", "/bin/bash", "-c"]

# # Set default shell to bash
# SHELL ["/bin/bash", "-c"]

# # Clone BharatOCR repository
# RUN git clone https://github.com/Bhashini-IITJ/BharatOCR.git && \
#     git switch photoOCR && \
#     cd IndicPhotoOCR && \
#     python setup.py sdist bdist_wheel && \
#     pip install ./dist/IndicPhotoOCR-1.1.0-py3-none-any.whl[cu118] --extra-index-url https://download.pytorch.org/whl/cu118

# # # Set default command to run BharatOCR
# CMD ["conda", "run", "-n", "bocr", "python", "-m", "IndicPhotoOCR.ocr"]


# cd IndicPhotoOCR
# sudo docker build -t indicphotoocr:latest .
# sudo docker run --gpus all --rm -it indicphotoocr:latest