Skip to content

Commit 9137f8b

Browse files
authored
feat: docker hub publish (#6)
* fix: docker compose lint * feat: docker hub ci * chore: linting
1 parent a10192e commit 9137f8b

File tree

2 files changed

+56
-3
lines changed

2 files changed

+56
-3
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Build & Push to Docker Hub
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Log in to Docker Hub
17+
uses: docker/login-action@v3
18+
with:
19+
username: ${{ secrets.DOCKERHUB_USERNAME }}
20+
password: ${{ secrets.DOCKERHUB_TOKEN }}
21+
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v3
24+
25+
- name: Build & push backend
26+
uses: docker/build-push-action@v5
27+
with:
28+
context: ./backend
29+
file: ./backend/Dockerfile
30+
push: true
31+
tags: |
32+
kushvinth/zell:latest-backend
33+
kushvinth/zell:${{ github.sha }}-backend
34+
cache-from: type=gha
35+
cache-to: type=gha,mode=max
36+
37+
- name: Build & push frontend
38+
uses: docker/build-push-action@v5
39+
with:
40+
context: ./frontend
41+
file: ./frontend/Dockerfile
42+
push: true
43+
tags: |
44+
kushvinth/zell:latest-frontend
45+
kushvinth/zell:${{ github.sha }}-frontend
46+
cache-from: type=gha
47+
cache-to: type=gha,mode=max

docker-compose.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,34 @@ services:
33
build:
44
context: ./backend
55
dockerfile: Dockerfile
6+
image: kushvinth/zell:latest-backend
67
restart: unless-stopped
78
environment:
89
ZELL_DB_PATH: /app/data/agents.db
910
ZELL_AGENTS_DATA_DIR: /app/agents_data
10-
CORS_ORIGINS: http://localhost:3000,http://127.0.0.1:3000,http://localhost:5173,http://127.0.0.1:5173
11+
CORS_ORIGINS: >
12+
http://localhost:${FRONTEND_PORT:-3000},
13+
http://127.0.0.1:${FRONTEND_PORT:-3000},
14+
http://localhost:5173,
15+
http://127.0.0.1:5173
1116
volumes:
1217
- backend_data:/app/data
1318
- backend_agents_data:/app/agents_data
1419
ports:
15-
- "8000:8000"
20+
- "${BACKEND_PORT:-8000}:8000"
1621
networks:
1722
- zell-network
1823

1924
frontend:
2025
build:
2126
context: ./frontend
2227
dockerfile: Dockerfile
28+
image: kushvinth/zell:latest-frontend
2329
restart: unless-stopped
2430
depends_on:
2531
- backend
2632
ports:
27-
- "3000:3000"
33+
- "${FRONTEND_PORT:-3000}:3000"
2834
networks:
2935
- zell-network
3036

0 commit comments

Comments
 (0)