Skip to content

Commit 8a02c69

Browse files
committed
Remove Docker image build step from GitHub Actions workflow
- Eliminated the Docker image build step to streamline the CI/CD process. - Updated the DockerRepository class to improve logging of the image build result, enhancing debugging capabilities.
1 parent 60bacc2 commit 8a02c69

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

.github/workflows/gbf_vector.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,6 @@ jobs:
3838
run: |
3939
echo "docker_host=unix://${HOME}/.colima/default/docker.sock" >> $GITHUB_OUTPUT
4040
41-
- name: Build Docker Image
42-
env:
43-
DOCKER_HOST: ${{ steps.docker-env.outputs.docker_host }}
44-
run: |
45-
cd docker
46-
docker build -t fastapi-app .
47-
docker images | grep fastapi-app
48-
4941
- name: Run Vector Action
5042
uses: ./
5143
env:

src/data/repository/docker_repository.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ export class DockerRepository {
1818
private readonly dockerDir: string;
1919

2020
private constructor() {
21-
this.docker = new Docker();
21+
// const dockerHost = process.env.DOCKER_HOST;
22+
// if (dockerHost) {
23+
// this.docker = new Docker({ socketPath: dockerHost.replace('unix://', '') });
24+
// } else {
25+
this.docker = new Docker();
26+
// }
2227
this.dockerDir = path.join(process.cwd(), 'docker');
2328
}
2429

@@ -48,7 +53,7 @@ export class DockerRepository {
4853
src: ['Dockerfile', 'requirements.txt', 'main.py']
4954
}, { t: 'fastapi-app' });
5055

51-
await new Promise((resolve, reject) => {
56+
const result = await new Promise((resolve, reject) => {
5257
this.docker.modem.followProgress(stream, (err: any, res: any) => {
5358
if (err) {
5459
logError('🐳 🔴 Error building image: ' + err);
@@ -64,6 +69,7 @@ export class DockerRepository {
6469
});
6570
});
6671

72+
logDebugInfo('🐳 🟡 Image build result: ' + result);
6773
logDebugInfo('🐳 🟡 Creating container...');
6874
// Create and start the container
6975
const container = await this.docker.createContainer({

0 commit comments

Comments
 (0)