Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,14 @@ jobs:
context: ./backend
push: false
tags: wardrowbe/backend:test
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=backend
cache-to: type=gha,mode=max,scope=backend

- name: Build frontend image
uses: docker/build-push-action@v7
with:
context: ./frontend
push: false
tags: wardrowbe/frontend:test
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=gha,scope=frontend
cache-to: type=gha,mode=max,scope=frontend
56 changes: 56 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docker Publish

on:
push:
branches: [main]
release:
types: [published]

env:
GHCR_REGISTRY: ghcr.io

jobs:
publish:
name: Publish ${{ matrix.service }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

strategy:
fail-fast: false
matrix:
include:
- service: backend
context: ./backend
tag_prefix: backend
- service: frontend
context: ./frontend
tag_prefix: frontend

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Lowercase image name
run: echo "GHCR_IMAGE_NAME=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v7
with:
context: ${{ matrix.context }}
push: true
tags: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}:${{ matrix.tag_prefix }}-latest
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}:${{ matrix.tag_prefix }}-${{ github.sha }}
cache-from: type=gha,scope=${{ matrix.service }}
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
14 changes: 3 additions & 11 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ services:

# FastAPI Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: ghcr.io/anyesh/wardrowbe:backend-latest
container_name: wardrobe_backend
restart: unless-stopped
extra_hosts:
Expand Down Expand Up @@ -91,9 +89,7 @@ services:

# arq Worker for background jobs
worker:
build:
context: ./backend
dockerfile: Dockerfile
image: ghcr.io/anyesh/wardrowbe:backend-latest
container_name: wardrobe_worker
restart: unless-stopped
command: arq app.workers.worker.WorkerSettings
Expand Down Expand Up @@ -130,11 +126,7 @@ services:

# Next.js Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: ""
image: ghcr.io/anyesh/wardrowbe:frontend-latest
container_name: wardrobe_frontend
restart: unless-stopped
extra_hosts:
Expand Down
12 changes: 3 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ services:

# FastAPI Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
image: ghcr.io/anyesh/wardrowbe:backend-latest
container_name: wardrobe-backend
extra_hosts:
- "host.docker.internal:host-gateway"
Expand Down Expand Up @@ -78,9 +76,7 @@ services:

# Next.js Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
image: ghcr.io/anyesh/wardrowbe:frontend-latest
container_name: wardrobe-frontend
environment:
NEXT_PUBLIC_API_URL: http://backend:8000
Expand All @@ -95,9 +91,7 @@ services:

# Background Worker for AI Tagging
worker:
build:
context: ./backend
dockerfile: Dockerfile
image: ghcr.io/anyesh/wardrowbe:backend-latest
container_name: wardrobe-worker
command: arq app.workers.worker.WorkerSettings
extra_hosts:
Expand Down