Skip to content
Open
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
96 changes: 96 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Runs the whole Dojo stack locally: `docker compose up --build`, then open http://localhost:8888.
# Signing in needs real Google OAuth credentials in GOOGLE_OAUTH_CLIENTID and GOOGLE_OAUTH_CLIENTSECRET (shell or .env).

services:
db:
image: postgres:18.4-alpine
environment:
POSTGRES_DB: dojo
POSTGRES_USER: admin
POSTGRES_PASSWORD: password
volumes:
- db-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U admin -d dojo"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped

storage:
image: rustfs/rustfs:1.0.1
environment:
RUSTFS_ACCESS_KEY: dojo_key
RUSTFS_SECRET_KEY: dojo_secret
RUSTFS_CONSOLE_ENABLE: "true"
# Log to stdout instead of /logs
RUSTFS_OBS_LOG_DIRECTORY: ""
ports:
- "9001:9001" # Web console
volumes:
- storage-data:/data
healthcheck:
test: ["CMD", "curl", "-fs", "http://localhost:9000/health"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped

# Creates the pictures bucket once storage is up, then exits
storage-init:
image: amazon/aws-cli:latest
environment:
AWS_ACCESS_KEY_ID: dojo_key
AWS_SECRET_ACCESS_KEY: dojo_secret
AWS_DEFAULT_REGION: ams3
entrypoint: ["sh", "-c"]
command:
- aws --endpoint-url http://storage:9000 s3api head-bucket --bucket dojo-dev 2>/dev/null
|| aws --endpoint-url http://storage:9000 s3api create-bucket --bucket dojo-dev
depends_on:
storage:
condition: service_healthy

dojo-server:
build: ./server-spring
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: dojo
DB_USER: admin
DB_PASSWORD: password
DOJO_BASE_URL: http://localhost:8888
AUTH_ALLOWED_ORIGINS: http://localhost:8888
GOOGLE_OAUTH_CLIENTID: ${GOOGLE_OAUTH_CLIENTID:-not-configured}
GOOGLE_OAUTH_CLIENTSECRET: ${GOOGLE_OAUTH_CLIENTSECRET:-not-configured}
GOOGLE_ALLOWED_DOMAIN: ${GOOGLE_ALLOWED_DOMAIN:-}
COOKIE_SECURE: "false"
API_DOCS_ENABLED: "true"
STORAGE_ENDPOINT: http://storage:9000
STORAGE_REGION: ams3
STORAGE_BUCKET: dojo-dev
STORAGE_ACCESS_KEY_ID: dojo_key
STORAGE_ACCESS_KEY_SECRET: dojo_secret
# The prod profile hardcodes this to false, an env var still overrides it
DOJO_FILESTORAGE_FORCEBASEPATHSTYLE: "true"
depends_on:
db:
condition: service_healthy
storage-init:
condition: service_completed_successfully
restart: unless-stopped

client:
build: ./client
environment:
BACKEND_URL: http://dojo-server:7777
VITE_GOOGLE_CLIENTID: ${GOOGLE_OAUTH_CLIENTID:-not-configured}
ports:
- "8888:80"
depends_on:
- dojo-server
restart: unless-stopped

volumes:
db-data:
storage-data:
4 changes: 2 additions & 2 deletions scripts/setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ The Dutch cities are the official places of residence (CBS woonplaatsen). Their
coordinates come from [GeoNames](https://www.geonames.org) and their regions and most populations
from [CBS](https://www.cbs.nl), both CC BY 4.0. The driving distances come from OSRM on
[OpenStreetMap](https://www.openstreetmap.org/copyright) data (© OpenStreetMap contributors, ODbL).
Country populations come from GeoNames and their English and Dutch names from the Unicode
[CLDR](https://cldr.unicode.org).
The countries' populations come from GeoNames and their
alternative English and Dutch names from the Unicode [CLDR](https://cldr.unicode.org).

The data is generated from a fixed seed, so every run produces exactly the same data. Names come
from Arabic, Turkish, Ukrainian, Spanish, Russian, English and Dutch backgrounds, all in Latin
Expand Down
30 changes: 19 additions & 11 deletions scripts/setup/dojo_setup/geo-data/countries.json
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@
"name": "DR Congo",
"alternativeNames": [
"Congo - Kinshasa",
"Congo (DRC)"
"Congo (DRC)",
"Democratic Republic of the Congo",
"Democratische Republiek Congo"
],
"population": 84068091,
"flag": "🇨🇩",
Expand Down Expand Up @@ -745,7 +747,9 @@
{
"id": "GM",
"name": "Gambia",
"alternativeNames": [],
"alternativeNames": [
"The Gambia"
],
"population": 2280102,
"flag": "🇬🇲",
"code": "GM"
Expand Down Expand Up @@ -905,8 +909,6 @@
"id": "HK",
"name": "Hong Kong",
"alternativeNames": [
"Hong Kong SAR China",
"Hongkong SAR van China",
"Hongkong"
],
"population": 7396076,
Expand Down Expand Up @@ -1192,9 +1194,7 @@
"id": "MO",
"name": "Macau",
"alternativeNames": [
"Macao SAR China",
"Macao",
"Macau SAR van China"
"Macao"
],
"population": 631636,
"flag": "🇲🇴",
Expand Down Expand Up @@ -2017,7 +2017,8 @@
"id": "SY",
"name": "Syria",
"alternativeNames": [
"Syrië"
"Syrië",
"Syrian Arab Republic"
],
"population": 16906283,
"flag": "🇸🇾",
Expand Down Expand Up @@ -2196,7 +2197,11 @@
"alternativeNames": [
"UK",
"Verenigd Koninkrijk",
"VK"
"VK",
"Great Britain",
"Groot-Brittannië",
"England",
"Engeland"
],
"population": 66488991,
"flag": "🇬🇧",
Expand All @@ -2209,7 +2214,10 @@
"US",
"USA",
"Verenigde Staten",
"VS"
"VS",
"America",
"Amerika",
"United States of America"
],
"population": 327167434,
"flag": "🇺🇸",
Expand Down Expand Up @@ -2336,4 +2344,4 @@
"flag": "🇿🇼",
"code": "ZW"
}
]
]
Loading
Loading