Skip to content

Commit 06a415a

Browse files
feat(docker): update development Docker Compose configuration and installation script
- Added image tags for Thoth microservices in the development Docker Compose file to support dynamic versioning. - Enhanced the installation script to export the THOTH_IMAGE_TAG environment variable, improving image management during service startup. - Updated service startup logic to pull pre-built images before launching containers, optimizing the deployment process. - Improved user feedback in the installation script to reflect the current image tag and service status during startup.
1 parent 9d8999e commit 06a415a

File tree

5 files changed

+230
-73
lines changed

5 files changed

+230
-73
lines changed

.github/workflows/nightly.yml

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,6 @@ jobs:
143143
cache-from: type=gha,scope=nightly-setup
144144
cache-to: type=gha,scope=nightly-setup,mode=max
145145

146-
- name: Build and push all-in-one image (nightly)
147-
uses: docker/build-push-action@v5
148-
with:
149-
context: .
150-
file: ./docker/all-in-one/Dockerfile
151-
push: true
152-
tags: |
153-
ghcr.io/${{ github.repository }}:nightly
154-
cache-from: type=gha,scope=nightly-aio
155-
cache-to: type=gha,scope=nightly-aio,mode=max
156-
build-args: |
157-
VERSION=${{ steps.version.outputs.version }}
158-
159146
build-nightly-service-images:
160147
name: Build Nightly Service - ${{ matrix.service }}
161148
needs: nightly-release
@@ -197,3 +184,55 @@ jobs:
197184
cache-to: type=gha,scope=nightly-${{ matrix.service }},mode=max
198185
build-args: |
199186
VERSION=${{ steps.version.outputs.version }}
187+
188+
# Dev images - used by docker-compose.dev.yml and the installer (pull instead of build)
189+
build-nightly-dev-images:
190+
name: Build Nightly Dev - ${{ matrix.service }}
191+
needs: nightly-release
192+
runs-on: ubuntu-latest
193+
strategy:
194+
matrix:
195+
include:
196+
- service: dev-api
197+
dockerfile: Dockerfile
198+
extras: service-api
199+
- service: dev-mcp
200+
dockerfile: docker/mcp/Dockerfile
201+
extras: service-mcp
202+
target: development
203+
- service: dev-discovery
204+
dockerfile: Dockerfile
205+
extras: service-discovery
206+
- service: dev-monitor
207+
dockerfile: Dockerfile
208+
extras: service-monitor
209+
- service: dev-dashboard
210+
dockerfile: Dockerfile
211+
extras: service-dashboard
212+
213+
steps:
214+
- uses: actions/checkout@v4
215+
216+
- name: Set up Docker Buildx
217+
uses: docker/setup-buildx-action@v3
218+
219+
- name: Login to GitHub Container Registry
220+
uses: docker/login-action@v3
221+
with:
222+
registry: ghcr.io
223+
username: ${{ github.actor }}
224+
password: ${{ secrets.GITHUB_TOKEN }}
225+
226+
- name: Build and push ${{ matrix.service }} (nightly)
227+
uses: docker/build-push-action@v5
228+
with:
229+
context: .
230+
file: ./${{ matrix.dockerfile }}
231+
push: true
232+
tags: |
233+
ghcr.io/${{ github.repository }}/${{ matrix.service }}:nightly
234+
target: ${{ matrix.target || '' }}
235+
cache-from: type=gha,scope=nightly-${{ matrix.service }}
236+
cache-to: type=gha,scope=nightly-${{ matrix.service }},mode=max
237+
build-args: |
238+
SERVICE_EXTRAS=${{ matrix.extras }}

.github/workflows/release.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,13 @@ jobs:
152152
cache-from: type=gha
153153
cache-to: type=gha,mode=max
154154

155-
build-all-in-one:
156-
name: Build All-in-One Image
155+
build-service-images:
156+
name: Build Service Images
157157
needs: create-release
158158
runs-on: ubuntu-latest
159+
strategy:
160+
matrix:
161+
service: [api, mcp, pdf-monitor, discovery]
159162

160163
steps:
161164
- uses: actions/checkout@v4
@@ -184,34 +187,50 @@ jobs:
184187
id: meta
185188
uses: docker/metadata-action@v5
186189
with:
187-
images: ghcr.io/${{ github.repository }}
190+
images: ghcr.io/${{ github.repository }}/${{ matrix.service }}
188191
tags: |
189192
type=raw,value=${{ needs.create-release.outputs.version }}
190193
type=semver,pattern={{major}}.{{minor}},value=${{ needs.create-release.outputs.version }},enable=${{ steps.release-type.outputs.is_stable }}
191-
type=semver,pattern={{major}},value=${{ needs.create-release.outputs.version }},enable=${{ steps.release-type.outputs.is_stable }}
192194
type=raw,value=latest,enable=${{ steps.release-type.outputs.is_stable }}
193195
type=raw,value=alpha,enable=${{ contains(needs.create-release.outputs.version, 'alpha') }}
194196
195-
- name: Build and push all-in-one image
197+
- name: Build and push ${{ matrix.service }}
196198
uses: docker/build-push-action@v5
197199
with:
198200
context: .
199-
file: ./docker/all-in-one/Dockerfile
201+
file: ./docker/${{ matrix.service }}/Dockerfile
200202
push: true
201203
tags: ${{ steps.meta.outputs.tags }}
202204
labels: ${{ steps.meta.outputs.labels }}
203-
cache-from: type=gha
204-
cache-to: type=gha,mode=max
205+
cache-from: type=gha,scope=${{ matrix.service }}
206+
cache-to: type=gha,scope=${{ matrix.service }},mode=max
205207
build-args: |
206208
VERSION=${{ needs.create-release.outputs.version }}
207209
208-
build-service-images:
209-
name: Build Service Images
210+
# Dev images - used by docker-compose.dev.yml and the installer (pull instead of build)
211+
build-dev-images:
212+
name: Build Dev Image - ${{ matrix.service }}
210213
needs: create-release
211214
runs-on: ubuntu-latest
212215
strategy:
213216
matrix:
214-
service: [api, mcp, pdf-monitor, discovery]
217+
include:
218+
- service: dev-api
219+
dockerfile: Dockerfile
220+
extras: service-api
221+
- service: dev-mcp
222+
dockerfile: docker/mcp/Dockerfile
223+
extras: service-mcp
224+
target: development
225+
- service: dev-discovery
226+
dockerfile: Dockerfile
227+
extras: service-discovery
228+
- service: dev-monitor
229+
dockerfile: Dockerfile
230+
extras: service-monitor
231+
- service: dev-dashboard
232+
dockerfile: Dockerfile
233+
extras: service-dashboard
215234

216235
steps:
217236
- uses: actions/checkout@v4
@@ -243,22 +262,22 @@ jobs:
243262
images: ghcr.io/${{ github.repository }}/${{ matrix.service }}
244263
tags: |
245264
type=raw,value=${{ needs.create-release.outputs.version }}
246-
type=semver,pattern={{major}}.{{minor}},value=${{ needs.create-release.outputs.version }},enable=${{ steps.release-type.outputs.is_stable }}
247265
type=raw,value=latest,enable=${{ steps.release-type.outputs.is_stable }}
248266
type=raw,value=alpha,enable=${{ contains(needs.create-release.outputs.version, 'alpha') }}
249267
250268
- name: Build and push ${{ matrix.service }}
251269
uses: docker/build-push-action@v5
252270
with:
253271
context: .
254-
file: ./docker/${{ matrix.service }}/Dockerfile
272+
file: ./${{ matrix.dockerfile }}
255273
push: true
256274
tags: ${{ steps.meta.outputs.tags }}
257275
labels: ${{ steps.meta.outputs.labels }}
276+
target: ${{ matrix.target || '' }}
258277
cache-from: type=gha,scope=${{ matrix.service }}
259278
cache-to: type=gha,scope=${{ matrix.service }},mode=max
260279
build-args: |
261-
VERSION=${{ needs.create-release.outputs.version }}
280+
SERVICE_EXTRAS=${{ matrix.extras }}
262281
263282
build-obsidian-plugin:
264283
name: Build Obsidian Plugin

docker-compose.dev.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ services:
2323
# PostgreSQL Database for Letta Memory System - EXTERNAL (optional fallback)
2424
thoth-api:
2525
profiles: ["microservices"]
26+
image: ghcr.io/acertainknight/project-thoth/dev-api:${THOTH_IMAGE_TAG:-latest}
2627
build:
2728
context: .
2829
dockerfile: Dockerfile
29-
# target: development # Not using multi-stage build
3030
args:
31-
SERVICE_EXTRAS: "service-api" # Includes api,discovery,pdf,langchain,vectordb,memory
31+
SERVICE_EXTRAS: "service-api"
3232
container_name: thoth-dev-api
3333
user: "1000:1000" # Run as host user for proper file permissions
3434
env_file:
@@ -93,6 +93,7 @@ services:
9393
# MCP Server (Model Context Protocol)
9494
thoth-mcp:
9595
profiles: ["microservices"]
96+
image: ghcr.io/acertainknight/project-thoth/dev-mcp:${THOTH_IMAGE_TAG:-latest}
9697
build:
9798
context: .
9899
dockerfile: docker/mcp/Dockerfile
@@ -159,12 +160,12 @@ services:
159160
# Discovery Service - Research Question Scheduler
160161
thoth-discovery:
161162
profiles: ["microservices"]
163+
image: ghcr.io/acertainknight/project-thoth/dev-discovery:${THOTH_IMAGE_TAG:-latest}
162164
build:
163165
context: .
164166
dockerfile: Dockerfile
165-
# target: development # Not using multi-stage build
166167
args:
167-
SERVICE_EXTRAS: "service-discovery" # Includes api,discovery,pdf,langchain,vectordb
168+
SERVICE_EXTRAS: "service-discovery"
168169
container_name: thoth-dev-discovery
169170
user: "1000:1000" # Run as host user for proper file permissions
170171
command: ["python", "-m", "thoth", "research", "scheduler"]
@@ -217,12 +218,12 @@ services:
217218
# Monitor Service (optimized PDF processing)
218219
thoth-monitor:
219220
profiles: ["microservices"]
221+
image: ghcr.io/acertainknight/project-thoth/dev-monitor:${THOTH_IMAGE_TAG:-latest}
220222
build:
221223
context: .
222224
dockerfile: Dockerfile
223-
# target: development # Not using multi-stage build
224225
args:
225-
SERVICE_EXTRAS: "service-monitor" # Includes api,pdf,discovery,mcp,langchain,vectordb,embeddings
226+
SERVICE_EXTRAS: "service-monitor"
226227
container_name: thoth-dev-pdf-monitor
227228
user: "1000:1000" # Run as host user for proper file permissions
228229
command: ["python", "-m", "thoth.run_monitor_standalone"]
@@ -274,6 +275,7 @@ services:
274275
# Dashboard Service
275276
thoth-dashboard:
276277
profiles: ["microservices"]
278+
image: ghcr.io/acertainknight/project-thoth/dev-dashboard:${THOTH_IMAGE_TAG:-latest}
277279
build:
278280
context: .
279281
dockerfile: Dockerfile

0 commit comments

Comments
 (0)