Skip to content

Commit 9a2ddb0

Browse files
committed
Setup docker build for cli module
1 parent 167fa11 commit 9a2ddb0

3 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/docker.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,8 @@ jobs:
4646
- name: Set up Docker Buildx
4747
uses: docker/setup-buildx-action@v3
4848

49-
- name: Build and push Docker image
49+
- name: Build and push backend Docker image
5050
run: sbt backend/Docker/publish
51+
52+
- name: Build and push CLI Docker image
53+
run: sbt cli/Docker/publish

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,22 @@ Then run:
116116
```bash
117117
docker compose up -d
118118
```
119+
120+
## Run CLI without building
121+
122+
You can use the pre-built CLI Docker image from [GitHub Container Registry](https://github.com/lenguyenthanh/fide/pkgs/container/fide-cli) to ingest historical CSV files into the database.
123+
124+
Assuming CSV files are in `./csv-data` and the docker-compose Postgres is running:
125+
126+
```bash
127+
docker run --rm \
128+
--network fide_fide \
129+
-v ./csv-data:/data \
130+
-e POSTGRES_HOST=fide_postgres \
131+
-e POSTGRES_PORT=5432 \
132+
-e POSTGRES_USER=admin \
133+
-e POSTGRES_PASSWORD=dummy \
134+
-e POSTGRES_DATABASE=fide \
135+
ghcr.io/lenguyenthanh/fide-cli:latest \
136+
ingest /data --start 2024-01 --end 2024-12
137+
```

build.sbt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,12 @@ lazy val cli = (project in file("modules/cli"))
126126
logback % Runtime
127127
),
128128
Compile / run / fork := true,
129-
Compile / run / connectInput := true
129+
Compile / run / connectInput := true,
130+
Docker / packageName := "lenguyenthanh/fide-cli",
131+
Docker / maintainer := "Thanh Le",
132+
Docker / dockerRepository := Some("ghcr.io")
130133
)
134+
.enablePlugins(JavaAppPackaging, DockerPlugin)
131135
.dependsOn(domain, full(db))
132136

133137
lazy val gatling = (project in file("modules/gatling"))

0 commit comments

Comments
 (0)