Skip to content

Commit

Permalink
chore: CockroachDB on Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Sep 12, 2024
1 parent c99f4b0 commit 8aabf1b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ VOLTASERVE_MOSAIC_PORT=8085
VOLTASERVE_CONSOLE_PORT=8086

# Infrastructure Ports
VOLTASERVE_POSTGRES_PORT=5432
VOLTASERVE_POSTGRES_PORT=26257
VOLTASERVE_COCKROACH_CONSOLE_PORT=18080
VOLTASERVE_MINIO_PORT=9000
VOLTASERVE_MINIO_CONSOLE_PORT=9001
Expand Down
2 changes: 1 addition & 1 deletion api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PUBLIC_UI_URL="http://127.0.0.1:3000"
CONVERSION_URL="http://127.0.0.1:8083"
LANGUAGE_URL="http://127.0.0.1:8084"
MOSAIC_URL="http://127.0.0.1:8085"
POSTGRES_URL="postgresql://[email protected]:5432/voltaserve"
POSTGRES_URL="postgresql://[email protected]:26257/voltaserve"

# Security
SECURITY_JWT_SIGNING_KEY="586cozl1x9m6zmu4fg8iwi6ajazguehcm9qdfgd5ndo2pc3pcn"
Expand Down
30 changes: 16 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@
# licenses/AGPL.txt.

volumes:
postgres:
cockroach:
minio:
meilisearch:
redis:

services:
postgres:
image: postgres:16
cockroach:
image: cockroachdb/cockroach:latest-v23.2
ports:
- ${VOLTASERVE_POSTGRES_PORT}:5432
- ${VOLTASERVE_POSTGRES_PORT}:26257
- ${VOLTASERVE_COCKROACH_CONSOLE_PORT}:8080
environment:
POSTGRES_USER: voltaserve
POSTGRES_PASSWORD: voltaserve
COCKROACH_DATABASE: voltaserve
COCKROACH_USER: voltaserve
volumes:
- postgres:/var/lib/postgresql/data
- cockroach:/cockroach/cockroach-data
command: start-single-node --insecure
healthcheck:
test: pg_isready -U voltaserve -d voltaserve -h localhost -p 5432 || exit 1
test: cockroach sql --insecure --execute='SELECT 1;' || exit 1
minio:
image: minio/minio:RELEASE.2024-04-06T05-26-02Z
ports:
Expand Down Expand Up @@ -72,7 +74,7 @@ services:
- CONVERSION_URL=http://conversion:8083
- LANGUAGE_URL=http://language:8084
- MOSAIC_URL=http://mosaic:8085
- POSTGRES_URL=postgresql://voltaserve:voltaserve@postgres:5432/voltaserve
- POSTGRES_URL=postgresql://voltaserve@cockroach:26257/voltaserve
- S3_URL=minio:9000
- SEARCH_URL=http://meilisearch:7700
- PUBLIC_UI_URL=http://${VOLTASERVE_HOSTNAME}:${VOLTASERVE_UI_PORT}
Expand All @@ -87,7 +89,7 @@ services:
healthcheck:
test: wget --quiet --spider http://127.0.0.1:8080/v2/health || exit 1
depends_on:
- postgres
- cockroach
- redis
- minio
- meilisearch
Expand All @@ -100,7 +102,7 @@ services:
- ${VOLTASERVE_IDP_PORT}:8081
environment:
- PORT=8081
- POSTGRES_URL=postgresql://voltaserve:voltaserve@postgres:5432/voltaserve
- POSTGRES_URL=postgresql://voltaserve@cockroach:26257/voltaserve
- SEARCH_URL=http://meilisearch:7700
- PUBLIC_UI_URL=http://${VOLTASERVE_HOSTNAME}:${VOLTASERVE_UI_PORT}
- SMTP_HOST=${VOLTASERVE_SMTP_HOST}
Expand All @@ -113,7 +115,7 @@ services:
healthcheck:
test: wget --quiet --spider http://127.0.0.1:8081/v2/health || exit 1
depends_on:
- postgres
- cockroach
- meilisearch
- minio
restart: on-failure
Expand Down Expand Up @@ -230,7 +232,7 @@ services:
build:
context: ./migrations
environment:
- DATABASE_URL=postgresql://voltaserve:voltaserve@postgres:5432/voltaserve
- DATABASE_URL=postgresql://voltaserve@cockroach:26257/voltaserve
depends_on:
- postgres
- cockroach
restart: on-failure
2 changes: 1 addition & 1 deletion idp/.env
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PORT=8081

# URLs
PUBLIC_UI_URL="http://127.0.0.1:3000"
POSTGRES_URL="postgresql://[email protected]:5432/voltaserve"
POSTGRES_URL="postgresql://[email protected]:26257/voltaserve"

# Token
TOKEN_JWT_SIGNING_KEY="586cozl1x9m6zmu4fg8iwi6ajazguehcm9qdfgd5ndo2pc3pcn"
Expand Down

0 comments on commit 8aabf1b

Please sign in to comment.