chore: local dev tilt wip
All checks were successful
/ build (map[dockerfile:./services/api/Dockerfile name:api]) (push) Successful in 42s
/ build (map[dockerfile:./services/watchers/Dockerfile name:watchers]) (push) Successful in 1m20s
/ build (map[dockerfile:./services/web/Dockerfile name:web]) (push) Successful in 1m21s
/ build (map[dockerfile:./services/app/Dockerfile name:app]) (push) Successful in 49s
/ build (map[dockerfile:./services/files/Dockerfile name:files]) (push) Successful in 1m12s
/ build (map[dockerfile:./services/tasks/Dockerfile name:tasks]) (push) Successful in 53s
/ build (map[dockerfile:./services/hasura/Dockerfile name:hasura]) (push) Successful in 1m0s
/ deploy (push) Successful in 8s
All checks were successful
/ build (map[dockerfile:./services/api/Dockerfile name:api]) (push) Successful in 42s
/ build (map[dockerfile:./services/watchers/Dockerfile name:watchers]) (push) Successful in 1m20s
/ build (map[dockerfile:./services/web/Dockerfile name:web]) (push) Successful in 1m21s
/ build (map[dockerfile:./services/app/Dockerfile name:app]) (push) Successful in 49s
/ build (map[dockerfile:./services/files/Dockerfile name:files]) (push) Successful in 1m12s
/ build (map[dockerfile:./services/tasks/Dockerfile name:tasks]) (push) Successful in 53s
/ build (map[dockerfile:./services/hasura/Dockerfile name:hasura]) (push) Successful in 1m0s
/ deploy (push) Successful in 8s
This commit is contained in:
parent
4198dc3ad9
commit
fc0733998e
9 changed files with 170 additions and 31 deletions
54
.env
Normal file
54
.env
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# DEV PORTS
|
||||
API_PORT=4200
|
||||
WEB_PORT=4203
|
||||
SERVICE_APP_PORT=4209
|
||||
FILES_PORT=4292
|
||||
|
||||
EXPOSE_API_PORT=4200
|
||||
EXPOSE_HASURA_PORT=4201
|
||||
EXPOSE_PG_PORT=4204
|
||||
EXPOSE_MINO_PORT=4290
|
||||
EXPOSE_MINIO_PORT=4290
|
||||
EXPOSE_MINO_CONSOLE_PORT=4291
|
||||
EXPOSE_MINIO_CONSOLE_PORT=4291
|
||||
MINIO_ROOT_USER=minio-admin
|
||||
MINIO_ROOT_PASSWORD=minio-admin
|
||||
EXPOSE_FILES_PORT=4292
|
||||
EXPOSE_REDIS_QD_PORT=4278
|
||||
EXPOSE_REDIS_HG_PORT=4279
|
||||
EXPOSE_KVROCKS_CG_PORT=4277
|
||||
|
||||
EXPOSE_RABBITMQ_NODE_PORT=4272
|
||||
EXPOSE_RABBITMQ_MANAGEMENT_PORT_PORT=4273
|
||||
|
||||
OSRM_CAR_PORT=4261
|
||||
OSRM_FOOT_PORT=4262
|
||||
OSRM_BICYCLE_PORT=4263
|
||||
|
||||
TILESERVERGL_PORT=4282
|
||||
NOMINATIM_PORT=4283
|
||||
|
||||
HASURA_CONSOLE_PORT=4295
|
||||
HASURA_CONSOLE_API_PORT=4293
|
||||
|
||||
# JWT
|
||||
CLAIMS_NAMESPACE=https://alertesecours.fr/claims
|
||||
|
||||
# APP
|
||||
APP_OA_FILES_URL=http://10.0.2.2:4292/api/v1/oas
|
||||
APP_GRAPHQL_URL=http://10.0.2.2:4201/v1/graphql
|
||||
APP_GRAPHQL_WS_URL=ws://10.0.2.2:4201/v1/graphql
|
||||
APP_OSRM_CAR_URL=http://10.0.2.2:4261
|
||||
APP_OSRM_FOOT_URL=http://10.0.2.2:4262
|
||||
APP_OSRM_BICYCLE_URL=http://10.0.2.2:4263
|
||||
APP_GEOLOC_SYNC_URL=http://10.0.2.2:4200/api/v1/oas/geoloc/sync
|
||||
# APP_MAPVIEW_STYLE_URL=https://tiles.alertesecours.fr/styles/basic-preview/style.json
|
||||
APP_MAPVIEW_STYLE_URL=http://10.0.2.2:4203/app/style.json
|
||||
# APP_MAPVIEW_STYLE_URL=https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json
|
||||
|
||||
# API KEY
|
||||
WHAT3WORDS_API_KEY=
|
||||
|
||||
# GoogleServices
|
||||
ANDROID_GOOGLE_SERVICES_FILE_PATH=/home/jo/.lab/alertesecours/google-services.json
|
||||
ANDROID_GOOGLE_SERVICES_FILE_PATH=/home/jo/.lab/alertesecours/GoogleService-Info.plist
|
||||
|
|
@ -8,7 +8,11 @@ EXPOSE_API_PORT=4200
|
|||
EXPOSE_HASURA_PORT=4201
|
||||
EXPOSE_PG_PORT=4204
|
||||
EXPOSE_MINO_PORT=4290
|
||||
EXPOSE_MINIO_PORT=4290
|
||||
EXPOSE_MINO_CONSOLE_PORT=4291
|
||||
EXPOSE_MINIO_CONSOLE_PORT=4291
|
||||
MINIO_ROOT_USER=minio-admin
|
||||
MINIO_ROOT_PASSWORD=minio-admin
|
||||
EXPOSE_FILES_PORT=4292
|
||||
EXPOSE_REDIS_QD_PORT=4278
|
||||
EXPOSE_REDIS_HG_PORT=4279
|
||||
|
|
|
|||
9
.tiltignore
Normal file
9
.tiltignore
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
**/node_modules/**
|
||||
**/.git/**
|
||||
**/.cache/**
|
||||
**/.dev-secrets/**
|
||||
**/android/**
|
||||
**/ios/**
|
||||
**/*.log
|
||||
osm-files/**
|
||||
tileserver-files/**
|
||||
33
DEVELOPER.md
33
DEVELOPER.md
|
|
@ -41,22 +41,37 @@ cp .env.default .env
|
|||
|
||||
### Start Services
|
||||
|
||||
Start all services with:
|
||||
Start all services with Tilt:
|
||||
```sh
|
||||
yarn dev:up
|
||||
```
|
||||
Or using devbox scripts:
|
||||
```sh
|
||||
devbox run dev:up
|
||||
yarn dev
|
||||
# or
|
||||
devbox run dev
|
||||
# or run a subset of services:
|
||||
tilt up api files hasura
|
||||
```
|
||||
|
||||
View logs:
|
||||
View logs in Tilt UI (web HUD opens automatically). CLI alternative:
|
||||
```sh
|
||||
yarn dev:logs
|
||||
# or
|
||||
tilt logs
|
||||
```
|
||||
Or using devbox:
|
||||
|
||||
Stop services:
|
||||
```sh
|
||||
devbox run dev:logs
|
||||
# If running in the foreground terminal:
|
||||
Ctrl-C
|
||||
# Or explicitly:
|
||||
tilt down
|
||||
```
|
||||
|
||||
Compose fallback (legacy):
|
||||
```sh
|
||||
yarn compose:up
|
||||
yarn compose:down
|
||||
# or via devbox:
|
||||
devbox run compose:up
|
||||
devbox run compose:down
|
||||
```
|
||||
|
||||
### Using Devbox
|
||||
|
|
|
|||
38
Tiltfile
Normal file
38
Tiltfile
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Tiltfile for as-services
|
||||
# Orchestrates docker-compose services with Tilt, providing a unified UI/logs and incremental workflows.
|
||||
|
||||
# Watch ignores are configured via .tiltignore
|
||||
|
||||
# Ensure .env exists so docker-compose gets expected env
|
||||
local_resource(
|
||||
name="ensure-env",
|
||||
cmd="bash -lc 'if [ ! -f .env ] && [ -f .env.default ]; then cp .env.default .env && echo Created .env from .env.default; fi'",
|
||||
allow_parallel=True,
|
||||
auto_init=True,
|
||||
)
|
||||
|
||||
# Optional: pre-pull builder image used in Dockerfiles
|
||||
local_resource(
|
||||
name="pull-builder",
|
||||
cmd="docker pull devthefuture/dockerfile-x",
|
||||
allow_parallel=True,
|
||||
auto_init=True,
|
||||
)
|
||||
|
||||
# Drive docker-compose with Tilt
|
||||
dc = docker_compose('./docker-compose.yaml')
|
||||
|
||||
# Compose services are registered via docker_compose; explicit resource dependencies
|
||||
# removed for compatibility with Tilt v0.35 (resource_deps not available).
|
||||
|
||||
# Optional groups for readability (requires Tilt Teams; keep commented if not used)
|
||||
# set_team_ui_settings({
|
||||
# 'resource_groups': {
|
||||
# 'core': ['db', 'rabbitmq', 'redis-q-dedup', 'redis-hot-geodata', 'kvrocks-cold-geodata', 'maildev'],
|
||||
# 'object-storage': ['minio', 'minio-setup'],
|
||||
# 'hasura': ['hasura', 'hasura_console'],
|
||||
# 'api-stack': ['api', 'files', 'tasks', 'watchers'],
|
||||
# 'geo': ['osrm-car', 'osrm-foot', 'tileserver-gl', 'nominatim', 'nominatim-pg'],
|
||||
# 'frontends': ['web', 'app'],
|
||||
# }
|
||||
# })
|
||||
|
|
@ -5,7 +5,8 @@
|
|||
"yarn",
|
||||
"git",
|
||||
"curl",
|
||||
"jq"
|
||||
"jq",
|
||||
"tilt"
|
||||
],
|
||||
"shell": {
|
||||
"init_hook": [
|
||||
|
|
|
|||
|
|
@ -74,6 +74,10 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"tilt": {
|
||||
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#tilt",
|
||||
"source": "nixpkg"
|
||||
},
|
||||
"yarn": {
|
||||
"resolved": "github:NixOS/nixpkgs/ca77296380960cd497a765102eeb1356eb80fed0?narHash=sha256-PgLSZDBEWUHpfTRfFyklmiiLBE1i1aGCtz4eRA3POao%3D#yarn",
|
||||
"source": "nixpkg",
|
||||
|
|
|
|||
|
|
@ -32,25 +32,25 @@ services:
|
|||
minio-setup:
|
||||
image: minio/mc:latest
|
||||
depends_on:
|
||||
- minio
|
||||
minio:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minio-admin}
|
||||
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minio-admin}
|
||||
entrypoint: >
|
||||
/bin/sh -c '
|
||||
set -e
|
||||
mc alias set myminio http://minio:9000 "$$MINIO_ROOT_USER" "$$MINIO_ROOT_PASSWORD";
|
||||
# wait for server to be ready
|
||||
entrypoint:
|
||||
- /bin/sh
|
||||
- -ec
|
||||
- |
|
||||
mc alias set myminio http://minio:9000 "$MINIO_ROOT_USER" "$MINIO_ROOT_PASSWORD"
|
||||
until mc ls myminio >/dev/null 2>&1; do
|
||||
echo "Waiting for MinIO to be ready...";
|
||||
sleep 1;
|
||||
done;
|
||||
echo "MinIO is up and running, configuring...";
|
||||
mc mb -p myminio/avatar || true;
|
||||
mc mb -p myminio/audio || true;
|
||||
mc anonymous set download myminio/avatar || true;
|
||||
echo "MinIO bucket setup complete.";
|
||||
'
|
||||
echo "Waiting for MinIO to be ready..."
|
||||
sleep 1
|
||||
done
|
||||
echo "MinIO is up and running, configuring..."
|
||||
mc mb -p myminio/avatar || true
|
||||
mc mb -p myminio/audio || true
|
||||
mc anonymous set download myminio/avatar || true
|
||||
echo "MinIO bucket setup complete."
|
||||
|
||||
rabbitmq:
|
||||
image: docker.io/rabbitmq:4.1
|
||||
|
|
@ -154,6 +154,12 @@ services:
|
|||
HASURA_GRAPHQL_ENDPOINT: http://localhost:${EXPOSE_HASURA_PORT:-4201}
|
||||
HASURA_INTERNAL_HOSTNAME: ${HASURA_INTERNAL_HOSTNAME:-hasura}
|
||||
HASURA_EXPOSE_PORT: ${EXPOSE_HASURA_PORT:-4201}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:${HASURA_CONSOLE_PORT:-4295}/ >/dev/null 2>&1 || curl -sf http://localhost:${HASURA_CONSOLE_PORT:-4295}/ >/dev/null"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
api:
|
||||
image: helpme_api:prod
|
||||
|
|
@ -381,6 +387,12 @@ services:
|
|||
- "${MAILDEV_SMTP_PORT:-4225}:1025"
|
||||
- "${MAILDEV_WEB_PORT:-4226}:1080"
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://localhost:${MAILDEV_WEB_PORT:-1080}/ >/dev/null 2>&1 || curl -sf http://localhost:${MAILDEV_WEB_PORT:-1080}/ >/dev/null"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
web:
|
||||
image: helpme_web
|
||||
|
|
|
|||
|
|
@ -20,9 +20,11 @@
|
|||
"tests/*"
|
||||
],
|
||||
"scripts": {
|
||||
"dev": "yarn dev:up && yarn dev:logs",
|
||||
"dev:up": "up",
|
||||
"dev:logs": "dev-logs",
|
||||
"dev": "tilt up",
|
||||
"dev:up": "tilt up",
|
||||
"dev:logs": "tilt logs",
|
||||
"compose:up": "scripts/up",
|
||||
"compose:down": "docker compose down -v",
|
||||
"up:modjo": "git stash && yarn up '@modjo/*' && git stash pop && yarn",
|
||||
"release": "commit-and-tag-version",
|
||||
"lint": "eslint .",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue