Skip to content

Commit

Permalink
Add docker compose file and instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
galt-tr committed Mar 23, 2022
1 parent 3dd47a1 commit 1789441
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ dist

# Code coverage
coverage.txt

# Development data dir
data/
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,22 @@ Checkout all the [examples](examples)!

<br/>

## Docker Compose Quickstart
To get started with development, `bux-server` provides a `docker-compose.yml`
file which starts up Bux Server with Redis and PostgreSQL. To start, we need to
tweak the `config/envs/development.json` file with the proper configuration.
First:
```
$ cp config/envs/docker-compose.json config/envs/development.json
```

Then, we need to update the `admin_key` with your xpub. Modify
`config/envs/development.json` with your admin key. Now we can start the
containers:
```
$ docker-compose up
```

## Contributing
View the [contributing guidelines](.github/CONTRIBUTING.md) and follow the [code of conduct](.github/CODE_OF_CONDUCT.md).

Expand Down
90 changes: 90 additions & 0 deletions config/envs/docker-compose.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"debug": true,
"debug_profiling": false,
"disable_itc": false,
"environment": "development",
"gdpr_compliance": false,
"authentication": {
"admin_key": "1234567",
"require_signing": false,
"scheme": "xpub",
"signing_disabled": false
},
"cache": {
"engine": "redis"
},
"datastore": {
"auto_migrate": true,
"engine": "postgresql",
"debug": true,
"table_prefix": "bux"
},
"graphql": {
"debug": true,
"enabled": true,
"server_path": "/graphql",
"playground_path": "/graphiql",
"require_signing": false
},
"mongodb": {
"database_name": "bux",
"transactions": false,
"uri": "mongodb://localhost:27017/bux"
},
"new_relic": {
"domain_name": "domain.com",
"enabled": false,
"license_key": "BOGUS-LICENSE-KEY-1234567890987654321234"
},
"paymail": {
"enabled": true,
"default_from_paymail": "from@domain.com",
"default_note": "bux Address Resolution",
"domains": [
"localhost"
],
"sender_validation_enabled": false
},
"redis": {
"dependency_mode": true,
"max_active_connections": 0,
"max_connection_lifetime": "60s",
"max_idle_connections": 10,
"max_idle_timeout": "10s",
"url": "redis://redis:6379",
"use_tls": false
},
"ristretto": {
"buffer_items": 64,
"ignore_internal_cost": false,
"max_cost": 1073741824,
"metrics": false,
"num_counters": 1e7
},
"server": {
"idle_timeout": "60s",
"port": "3003",
"read_timeout": "15s",
"write_timeout": "15s"
},
"sql": {
"host": "db",
"name": "bux",
"password": "postgres",
"port": "5432",
"replica": false,
"skip_initialize_with_version": true,
"time_zone": "UTC",
"tx_timeout": "10s",
"user": "bux"
},
"sqlite": {
"database_path": "",
"shared": true
},
"task_manager": {
"engine": "taskq",
"factory": "memory",
"queue_name": "development_queue"
}
}
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.9"
services:
server:
build: .
environment:
- BUX_ENVIRONMENT=development
ports:
- "3003:30003"
volumes:
- ./config:/config:Z
links:
- redis
- db
redis:
image: redis
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data:Z
environment:
- POSTGRES_NAME=bux
- POSTGRES_USER=bux
- POSTGRES_PASSWORD=postgres

0 comments on commit 1789441

Please sign in to comment.