Skip to content

Commit 07b83e5

Browse files
committed
❇️ refactor: Move backend Dockerfile
1 parent 77fe63c commit 07b83e5

5 files changed

Lines changed: 19 additions & 12 deletions

File tree

.github/workflows/ci-pipeline.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
api-key: 2d7865a44aa575d857521faaee1a57f8
7272

7373
build:
74-
name: "🏗️ Build"
74+
name: "🏗️ Build Backend Image"
7575
runs-on: ubuntu-latest
7676
needs: [test, lint, license]
7777
if: success() && github.ref == 'refs/heads/develop'
@@ -88,10 +88,15 @@ jobs:
8888
ghcr.io/${{ github.repository }}
8989
tags: |
9090
type=edge
91+
labels: |
92+
org.opencontainers.image.title=kayman-backend
93+
org.opencontainers.image.documentation=${{ github.repository }}/wiki
94+
org.opencontainers.image.authors=tomy0000000
9195
9296
- name: "🏗 Build and Push Image"
9397
uses: tomy0000000/actions/build-push-image@main
9498
with:
9599
docker_password: ${{ secrets.DOCKER_PASSWORD }}
96100
tags: ${{ steps.meta.outputs.tags }}
97101
labels: ${{ steps.meta.outputs.labels }}
102+
context: "./backend"

backend/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Dockerfile
2+
.dockerignore
3+
README.md
4+
.git
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
FROM python:3.12
2-
3-
LABEL tech.tomy.docker.kayman="0.10.0"
4-
LABEL maintainer="Tomy Hsieh @tomy0000000"
1+
# syntax=docker.io/docker/dockerfile:1
52

3+
FROM python:3.12
64
WORKDIR /usr/src/kayman
75
EXPOSE 8000
86

97
# Install pip & poetry
108
RUN pip install --upgrade pip poetry
119

1210
# Copy dependencies
13-
COPY backend/pyproject.toml backend/poetry.lock /usr/src/kayman/
11+
COPY pyproject.toml poetry.lock ./
1412

15-
# Install Dependencies
13+
# Install dependencies
1614
RUN poetry config virtualenvs.create false && \
1715
poetry install --no-interaction --no-ansi
1816

19-
# Copy Application
20-
COPY backend/ /usr/src/kayman
17+
# Copy application
18+
COPY . .
2119

22-
# Run Application
20+
# Run application
2321
ENTRYPOINT [ "uvicorn", "kayman.main:app", "--host", "0.0.0.0", "--port", "8000" ]

docker-compose.override.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55
- "3000:3000"
66

77
backend:
8-
build: .
8+
build: "./backend"
99
command: "--reload --log-level trace"
1010
ports:
1111
- "8000:8000"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
- "db"
1313
env_file:
1414
- "instance/.env"
15-
image: "tomy0000000/kayman"
15+
image: "tomy0000000/kayman-backend"
1616
restart: "always"
1717
volumes:
1818
- "./instance:/usr/src/kayman/instance"

0 commit comments

Comments
 (0)