Skip to content

Instantly share code, notes, and snippets.

@dresswithpockets
Last active February 21, 2022 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dresswithpockets/0e9dc476c8d5833cff76b06a547046b8 to your computer and use it in GitHub Desktop.
Save dresswithpockets/0e9dc476c8d5833cff76b06a547046b8 to your computer and use it in GitHub Desktop.
version: '3'
services:
cockroachdb:
image: cockroachdb/cockroach:latest-v20.2
command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
restart: "no"
volumes:
- data:/var/lib/cockroach
expose:
- "8080"
- "26257"
ports:
- "26257:26257"
- "8080:8080"
nakama:
image: heroiclabs/nakama:3.9.0
entrypoint:
- "/bin/sh"
- "-ecx"
- >
/nakama/nakama migrate up --database.address root@cockroachdb:26257 &&
exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257 --logger.level DEBUG --session.token_expiry_sec 7200 --metrics.prometheus_port 9100
restart: "no"
links:
- "cockroachdb:db"
depends_on:
- cockroachdb
- prometheus
volumes:
- ./:/nakama/data
expose:
- "7349"
- "7350"
- "7351"
- "9100"
ports:
- "7349:7349"
- "7350:7350"
- "7351:7351"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:7350/"]
interval: 10s
timeout: 5s
retries: 5
prometheus:
image: prom/prometheus
entrypoint: /bin/sh -c
command: |
'sh -s <<EOF
cat > ./prometheus.yml <<EON
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
- job_name: nakama
metrics_path: /
static_configs:
- targets: ['nakama:9100']
EON
prometheus --config.file=./prometheus.yml
EOF'
ports:
- '9090:9090'
volumes:
data:
public static class TaskExtensions
{
public static Task OnSuccess(this Task task, Action<Task> success)
{
_ = task.ContinueWith(success, TaskContinuationOptions.OnlyOnRanToCompletion);
return task;
}
public static Task OnError(this Task task, Action<Task> error)
{
_ = task.ContinueWith(error, TaskContinuationOptions.NotOnRanToCompletion);
return task;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment