Skip to content
This repository was archived by the owner on Jul 3, 2026. It is now read-only.

Commit 0854ddc

Browse files
committed
feat: OCR 이미지
0 parents  commit 0854ddc

6 files changed

Lines changed: 1748 additions & 0 deletions

File tree

‎.github/workflows/deploy.yaml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy to ECR
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
concurrency:
9+
group: deploy-to-ecr
10+
cancel-in-progress: true
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
22+
- name: AWS Credentials Configuration
23+
uses: aws-actions/configure-aws-credentials@v4
24+
with:
25+
aws-region: ${{ secrets.AWS_REGION }}
26+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
27+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28+
29+
- name: Login to Amazon ECR
30+
uses: aws-actions/amazon-ecr-login@v2
31+
32+
- name: Build and push Docker image
33+
run: |
34+
docker build -t classpick/ocr .
35+
docker tag classpick/ocr ${{ secrets.AWS_ECR_URL }}/classpick/ocr:${{ github.sha }}
36+
docker push ${{ secrets.AWS_ECR_URL }}/classpick/ocr:${{ github.sha }}

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
*.iml
3+
.DS_Store

‎Dockerfile‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM public.ecr.aws/sam/build-python3.9 AS builder
2+
3+
RUN yum install -y gcc gcc-c++ make libgomp libSM libXrender libXext mesa-libGL-devel python3-devel \
4+
&& yum clean all
5+
6+
WORKDIR /build
7+
8+
COPY Pipfile Pipfile.lock ./
9+
10+
RUN pip3 install pipenv \
11+
&& pipenv requirements > requirements.txt \
12+
&& pip3 install --target /install --no-cache-dir -r requirements.txt \
13+
&& python3 - <<EOF
14+
from paddleocr import PaddleOCR
15+
PaddleOCR(use_angle_cls=True, lang="korean")
16+
EOF
17+
18+
19+
FROM public.ecr.aws/lambda/python:3.9
20+
21+
RUN yum install -y libgomp libSM libXrender libXext mesa-libGL \
22+
&& yum clean all
23+
24+
WORKDIR /var/task
25+
26+
COPY --from=builder /install /var/task
27+
28+
COPY app.py ./
29+
30+
CMD ["app.lambda_handler"]

‎Pipfile‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[packages]
7+
paddleocr = "*"
8+
opencv-python-headless = "*"
9+
requests = "*"
10+
numpy = "*"
11+
paddlepaddle = "*"
12+
boto3 = "*"
13+
14+
[dev-packages]
15+
16+
[requires]
17+
python_version = "3.9"
18+
python_full_version = "3.9.6"

0 commit comments

Comments
 (0)