Skip to content

Commit

Permalink
add own docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
KwilLuke committed Oct 4, 2024
1 parent adf2d03 commit 1a108f4
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ jobs:
cd /tmp/kwil-db
go work init && go work use . ./test ./core
task build:docker
cd deployments/compose/kwil
echo "Starting kwil docker"
sed -i -e "/--autogen/a --app.private-rpc" docker-compose.yml
cd ../..
cd .github/workflows
docker compose up -d
cd -
Expand All @@ -110,5 +109,5 @@ jobs:
- name: Cleanup Docker
if: always()
run: |
docker compose -f /tmp/kwil-db/deployments/compose/kwil/docker-compose.yml down
docker compose -f docker-compose.yml down
docker system prune -af
78 changes: 78 additions & 0 deletions .github/workflows/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
version: "3"

volumes:
pgkwil:
driver: local

services:
pg:
container_name: postgres-kwild-single
image: kwildb/postgres:16.4-1
ports:
- "15432:5432"
restart: always
user: postgres
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_INITDB_ARGS: --data-checksums
# Setting user/pass/db works, but we use docker-entrypoint-initdb.d instead for more control
# POSTGRES_USER: kwild
# POSTGRES_PASSWORD: kwild
# POSTGRES_DB: kwild
volumes:
- pgkwil:/var/lib/postgresql/data
networks:
kwilnet0:
ipv4_address: 172.5.100.3
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 2s
timeout: 6s
retries: 10

kwild:
container_name: kwild-single
image: kwild:latest
build:
context: ../../../
dockerfile: ./build/package/docker/kwild.dockerfile
ports:
- "8484:8484"
- "26656:26656"
- "26657:26657"
environment:
- LOG=${LOG:-cometbft.log}
- KWILD_HOME=/app/.kwild
volumes:
- ./testnode/:/app/.kwild/
depends_on:
pg:
condition: service_healthy
networks:
kwilnet0:
ipv4_address: 172.5.100.2
command: |
--autogen
--root-dir=/app/.kwild
--app.private-rpc
--log.level=debug
--app.admin-listen-addr=/tmp/admin.socket
--chain.p2p.external-address=tcp://0.0.0.0:26656
--chain.rpc.listen-addr=tcp://0.0.0.0:26657
--app.pg-db-host=172.5.100.3
--app.pg-db-port=5432
--app.pg-db-user=kwild
--app.pg-db-pass=kwild
healthcheck:
test: ["CMD", "curl", "--fail-with-body", "-s", "http://127.0.0.1:8484/api/v1/health/user"]
interval: 2s
timeout: 6s
retries: 10

networks:
kwilnet0:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.5.100.0/23

0 comments on commit 1a108f4

Please sign in to comment.