Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

fix docker-compose up #200

Merged
merged 3 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# for local development
ROOM_HOST=localhost:10000
REDIS_HOST=localhost:6379 # when use docker-compose use redis exposed port
GRPC_PORT=10001
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ This project is experimental and not ready for production

## Quick Start

Docker導入済み環境ではDockerComposeを用いて簡単にiguagile-engineを動かすことができます.

```bash
git clone git@github.com:iguagile/iguagile-engine.git
cd iguagile-engine
docker-compose up
# connect to tcp 4000 port.
curl http://localhost:8080/api/v1/rooms -X POST -d '{"application_name": "example", "version": "0.1.0", "password": "IiHqswslP2Yr3b3P", "max_user": 4, "information": {}}'
# response
# {"success":true,"result":{"room_id":65536,"require_password":false,"max_user":0,"connected_user":0,"server":{"server":"192.168.10.5","port":10000},"token":"BHB2dVhpT1GcP4IKN9iLJw==","information":null},"error":""}
# connect to 192.168.10.5:10000
```
41 changes: 38 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,48 @@ version: '3.1'
services:
redis:
image: redis:latest
ports:
- "6379:6379"
networks:
- iguagile-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]

iguagile-api:
image: ghcr.io/iguagile/iguagile-engine:latest
image: ghcr.io/iguagile/iguagile-api:latest
ports:
- "8080:80"
environment:
REDIS_HOST: redis:6379
GRPC_HOST: iguagile-engine:10000
networks:
- iguagile-network
depends_on:
redis:
condition: service_healthy

iguagile-engine:
# # comments out for local development
# build:
# context: .
# dockerfile: Dockerfile
image: ghcr.io/iguagile/iguagile-engine:latest
ports:
- "14000:4000"
- "15000:5000"
networks:
iguagile-network:
ipv4_address: 192.168.10.5 # assign for connect by host machine
environment:
ROOM_HOST: 192.168.10.5:10000 # require other container connect hostname
REDIS_HOST: redis:6379 # register server pub/sub and id generator
GRPC_PORT: 10001 # server register rpc
depends_on:
redis:
condition: service_healthy

networks:
iguagile-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.10.0/24
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/iguagile/iguagile-room-proto v0.0.0-20230622035817-c6a324325a06 h1:Yhl4+KVjQsTTwPVUwYqqrDizEeOEVVW3xRqB0ZkmbHY=
github.com/iguagile/iguagile-room-proto v0.0.0-20230622035817-c6a324325a06/go.mod h1:LZFMietn7XTkDTqBBbRaX/FyQ5cOGSnU5RTq6jzUxD8=
github.com/iguagile/iguagile-room-proto v0.0.0-20230709141737-b58cae5f0141 h1:zHIIb2DzUu2J6vVCzLQCpKRln8Syg0nKLWrxs29y8q0=
github.com/iguagile/iguagile-room-proto v0.0.0-20230709141737-b58cae5f0141/go.mod h1:v7WltIb/HJOwsI1jrp+nHjv7vzE8DmrdX/QoTpcyPuc=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
Expand Down
Loading