MukeshKapoor25 commited on
Commit
8f31071
·
1 Parent(s): b46f788

Standardize Dockerfile (port 8000) and add GHCR workflow

Browse files
.github/workflows/docker-image-ci.yml ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Docker Image CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ env:
10
+ REGISTRY: ghcr.io
11
+ IMAGE_NAME: ${{ github.repository }}
12
+
13
+ jobs:
14
+ build-and-push:
15
+ runs-on: ubuntu-latest
16
+ permissions:
17
+ contents: read
18
+ packages: write
19
+
20
+ steps:
21
+ - name: Checkout repository
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Log in to the Container registry
25
+ uses: docker/login-action@v3
26
+ with:
27
+ registry: ${{ env.REGISTRY }}
28
+ username: ${{ github.actor }}
29
+ password: ${{ secrets.GITHUB_TOKEN }}
30
+
31
+ - name: Extract metadata (tags, labels) for Docker
32
+ id: meta
33
+ uses: docker/metadata-action@v5
34
+ with:
35
+ images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
36
+ tags: |
37
+ type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
38
+ type=sha
39
+
40
+ - name: Build and push Docker image
41
+ uses: docker/build-push-action@v5
42
+ with:
43
+ context: .
44
+ push: true
45
+ tags: ${{ steps.meta.outputs.tags }}
46
+ labels: ${{ steps.meta.outputs.labels }}
Dockerfile CHANGED
@@ -22,7 +22,6 @@ RUN pip install --no-cache-dir --upgrade pip && \
22
 
23
  COPY --chown=user . /app
24
 
25
- EXPOSE 7860
26
 
27
-
28
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4", "--log-level", "info"]
 
22
 
23
  COPY --chown=user . /app
24
 
25
+ EXPOSE 8000
26
 
27
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4", "--log-level", "info"]