-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CockroachDB Docker Compose setup for Simple Pongo sample
- Loading branch information
1 parent
ca81e7f
commit 0e27f26
Showing
6 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM haproxy:lts-bullseye | ||
|
||
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg | ||
|
||
EXPOSE 26257 | ||
EXPOSE 8080 | ||
EXPOSE 8081 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
global | ||
log stdout format raw local0 info | ||
maxconn 20000 | ||
|
||
defaults | ||
log global | ||
timeout connect 10m | ||
timeout client 30m | ||
timeout server 30m | ||
option clitcpka | ||
option tcplog | ||
|
||
listen cockroach-jdbc | ||
bind :26000 | ||
mode tcp | ||
balance leastconn | ||
option httpchk GET /health?ready=1 | ||
server roach-0 roach-0:26257 check port 8080 | ||
server roach-1 roach-1:26257 check port 8080 | ||
server roach-2 roach-2:26257 check port 8080 | ||
|
||
listen cockroach-ui | ||
bind :8080 | ||
mode tcp | ||
balance leastconn | ||
option httpchk GET /health | ||
server roach-0 roach-0:8080 check port 8080 | ||
server roach-1 roach-1:8080 check port 8080 | ||
server roach-2 roach-2:8080 check port 8080 | ||
|
||
listen stats | ||
bind :8081 | ||
mode http | ||
stats enable | ||
stats hide-version | ||
stats realm Haproxy\ Statistics | ||
stats uri / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
version: '3.9' | ||
|
||
# Took from: https://github.com/dbist/cockroach-docker | ||
# Connect to db console with: docker exec -it roach-0 ./cockroach sql --host=roach-0:26257 --insecure | ||
|
||
services: | ||
roach-0: | ||
container_name: roach-0 | ||
hostname: roach-0 | ||
image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 | ||
command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-0:26257 --advertise-addr=roach-0:26257 --max-sql-memory=.25 --cache=.25 | ||
environment: | ||
- 'ALLOW_EMPTY_PASSWORD=yes' | ||
- 'COCKROACH_USER=postgres' | ||
- 'COCKROACH_PASSWORD=postgres' | ||
- 'COCKROACH_DATABASE=postgres' | ||
|
||
roach-1: | ||
container_name: roach-1 | ||
hostname: roach-1 | ||
image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 | ||
command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-1:26257 --advertise-addr=roach-1:26257 --max-sql-memory=.25 --cache=.25 | ||
environment: | ||
- 'ALLOW_EMPTY_PASSWORD=yes' | ||
- 'COCKROACH_USER=postgres' | ||
- 'COCKROACH_PASSWORD=postgres' | ||
- 'COCKROACH_DATABASE=postgres' | ||
|
||
roach-2: | ||
container_name: roach-2 | ||
hostname: roach-2 | ||
image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 | ||
command: start --insecure --join=roach-0,roach-1,roach-2 --listen-addr=roach-2:26257 --advertise-addr=roach-2:26257 --max-sql-memory=.25 --cache=.25 | ||
environment: | ||
- 'ALLOW_EMPTY_PASSWORD=yes' | ||
- 'COCKROACH_USER=postgres' | ||
- 'COCKROACH_PASSWORD=postgres' | ||
- 'COCKROACH_DATABASE=postgres' | ||
|
||
init: | ||
container_name: init | ||
image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 | ||
command: init --host=roach-0 --insecure | ||
environment: | ||
- 'ALLOW_EMPTY_PASSWORD=yes' | ||
- 'COCKROACH_USER=postgres' | ||
- 'COCKROACH_PASSWORD=postgres' | ||
- 'COCKROACH_DATABASE=postgres' | ||
depends_on: | ||
- roach-0 | ||
|
||
lb: | ||
container_name: lb | ||
hostname: lb | ||
build: cockroachdb/haproxy | ||
ports: | ||
- '5432:26000' | ||
- '8080:8080' | ||
- '8081:8081' | ||
depends_on: | ||
- roach-0 | ||
- roach-1 | ||
- roach-2 | ||
|
||
client: | ||
container_name: client | ||
hostname: client | ||
image: cockroachdb/cockroach-unstable:v23.2.0-beta.1 | ||
entrypoint: ['/usr/bin/tail', '-f', '/dev/null'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters