File tree Expand file tree Collapse file tree 5 files changed +141
-6
lines changed Expand file tree Collapse file tree 5 files changed +141
-6
lines changed Original file line number Diff line number Diff line change 1+ name : Create and publish a Docker image
2+
3+ on :
4+ workflow_dispatch :
5+ workflow_call :
6+ inputs :
7+ registry :
8+ description : Container registry domain
9+ required : true
10+ type : string
11+ image-name :
12+ description : Name for the Docker image
13+ required : true
14+ type : string
15+ image-file :
16+ description : Dockerfile used to build the image
17+ required : true
18+ type : string
19+
20+ permissions :
21+ contents : read
22+ packages : write
23+ attestations : write
24+ id-token : write
25+
26+ jobs :
27+ build-and-push-image :
28+ runs-on : ubuntu-latest
29+
30+ steps :
31+ - name : Checkout repository
32+ uses : actions/checkout@v4
33+
34+ - name : Extract metadata
35+ id : meta-backend
36+ uses : docker/metadata-action@v5
37+ with :
38+ images : ${{ inputs.registry }}/${{ inputs.image-name }}/${{ inputs.image-file }}
39+ tags : |
40+ type=ref,event=branch
41+ type=sha,format=short
42+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
43+
44+ - name : Log in to the Container registry
45+ uses : docker/login-action@v3
46+ with :
47+ registry : ${{ inputs.registry }}
48+ username : ${{ github.actor }}
49+ password : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - name : Set up Docker Buildx
52+ uses : docker/setup-buildx-action@v3
53+
54+ - name : Build and push Docker image
55+ id : push-image
56+ uses : docker/build-push-action@v6
57+ with :
58+ context : .
59+ push : true
60+ file : ./${{ inputs.image-file }}.dockerfile
61+ tags : ${{ steps.meta-backend.outputs.tags }}
62+ labels : ${{ steps.meta-backend.outputs.labels }}
63+ cache-from : type=gha
64+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 7171 with :
7272 context : .
7373 push : true
74- file : ./ingester .dockerfile
74+ file : ./ingest .dockerfile
7575 tags : ${{ steps.meta-ingester.outputs.tags }}
7676 labels : ${{ steps.meta-ingester.outputs.labels }}
7777 cache-from : type=gha
Original file line number Diff line number Diff line change @@ -5,13 +5,19 @@ services:
55 shm_size : 1g
66 env_file :
77 - .env
8- ports :
9- - 5432:5432
8+ expose :
9+ - 5432
1010 volumes :
11- - ./data :/var/lib/postgresql/data
11+ - postgres_data :/var/lib/postgresql/data
1212 restart : unless-stopped
1313 networks :
1414 - cairo_coder
15+ healthcheck :
16+ test : ['CMD-SHELL', 'pg_isready -U yo -d cairo_coder_db']
17+ interval : 5s
18+ timeout : 5s
19+ retries : 5
20+ start_period : 10s
1521
1622 backend :
1723 container_name : ' backend'
@@ -26,7 +32,7 @@ services:
2632 - packages/backend/.env
2733 depends_on :
2834 postgres :
29- condition : service_started
35+ condition : service_healthy
3036 restart : unless-stopped
3137 networks :
3238 - cairo_coder
@@ -38,7 +44,7 @@ services:
3844 profiles : ['ingester']
3945 depends_on :
4046 postgres :
41- condition : service_started
47+ condition : service_healthy
4248 networks :
4349 - cairo_coder
4450
Original file line number Diff line number Diff line change 1+ services :
2+ cairo-coder-postgres :
3+ image : pgvector/pgvector:pg17
4+ container_name : cairo-coder-postgres
5+ shm_size : 1g
6+ env_file :
7+ - .env
8+ volumes :
9+ - postgres_data:/var/lib/postgresql/data
10+ restart : unless-stopped
11+ networks :
12+ - cairo_coder
13+ healthcheck :
14+ test : ['CMD-SHELL', 'pg_isready -U yo -d cairo_coder_db']
15+ interval : 5s
16+ timeout : 5s
17+ retries : 5
18+ start_period : 10s
19+
20+ cairo-coder-backend :
21+ image : gchr.io/repo/cairo-coder-backend:123456
22+ container_name : cairo-coder-backend
23+ env_file :
24+ - packages/backend/.env
25+ expose :
26+ - 3001
27+ depends_on :
28+ - postgres :
29+ condition : service_healthy
30+ restart : unless-stopped
31+ networks :
32+ - cairo_coder
33+ - services
34+ deploy :
35+ resources :
36+ limits :
37+ memory : 4G
38+ labels :
39+ - ' traefik.enable=true'
40+ - ' traefik.docker.network=services'
41+ - ' traefik.http.routers.proxy.rule=Host(cairo-coder.kasar.io)'
42+ - ' traefik.http.routers.proxy.entrypoints=websecure'
43+ - ' traefik.http.routers.proxy.tls.certresolver=letsencrypt'
44+ - ' traefik.http.services.proxy.loadbalancer.server.port=3001'
45+
46+ cairo-coder-ingester :
47+ image : gchr.io/repo/cairo-coder-ingester:123456
48+ container_name : cairo-coder-ingester
49+ depends_on :
50+ - postgres :
51+ condition : service_healthy
52+ - backend :
53+ condition : service_started
54+ restart : ' no'
55+ networks :
56+ - cairo_coder
57+
58+ networks :
59+ cairo_coder :
60+ internal : true
61+ services :
62+ external : true
63+
64+ volumes :
65+ postgres_data :
File renamed without changes.
You can’t perform that action at this time.
0 commit comments