fix(local-dev): add minio to default local env. (#1872)

This add minio to the default setup to be able to run
the whole solution out of the box.

Signed-off-by: Christoph Bühler <cbuehler@rootd.ch>
This commit is contained in:
Christoph Bühler 2021-06-25 09:39:31 +02:00 committed by GitHub
parent c93e3370d2
commit c6c60d1d2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 62 additions and 20 deletions

View File

@ -1,8 +1,8 @@
version: "3.8" version: '3.8'
services: services:
db: db:
profiles: ["database"] profiles: ['database']
restart: always restart: always
networks: networks:
- zitadel - zitadel
@ -11,9 +11,29 @@ services:
ports: ports:
- 8080:8080 - 8080:8080
- 26257:26257 - 26257:26257
minio:
profiles: ['backend']
image: minio/minio:RELEASE.2021-06-14T01-29-23Z
restart: on-failure
networks:
- zitadel
environment:
- MINIO_ACCESS_KEY=access_key
- MINIO_SECRET_KEY=secret_key
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:9000/minio/health/live']
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
command:
- gateway
- nas
- /export
db-migrations: db-migrations:
profiles: ["database"] profiles: ['database']
restart: on-failure restart: on-failure
networks: networks:
- zitadel - zitadel
@ -31,9 +51,9 @@ services:
- FLYWAY_PLACEHOLDERS_authzpassword=NULL - FLYWAY_PLACEHOLDERS_authzpassword=NULL
- FLYWAY_PLACEHOLDERS_queriespassword=NULL - FLYWAY_PLACEHOLDERS_queriespassword=NULL
command: -url=jdbc:postgresql://db:26257/defaultdb -user=root -password= -connectRetries=5 migrate command: -url=jdbc:postgresql://db:26257/defaultdb -user=root -password= -connectRetries=5 migrate
keys: keys:
profiles: ["init-backend"] profiles: ['init-backend']
restart: on-failure restart: on-failure
networks: networks:
- zitadel - zitadel
@ -47,7 +67,7 @@ services:
- ./local.env - ./local.env
backend-setup: backend-setup:
profiles: ["init-backend"] profiles: ['init-backend']
restart: on-failure restart: on-failure
networks: networks:
- zitadel - zitadel
@ -63,17 +83,24 @@ services:
- ../../.keys:/go/src/github.com/caos/zitadel/.keys - ../../.keys:/go/src/github.com/caos/zitadel/.keys
env_file: env_file:
- ./local.env - ./local.env
environment: environment:
- ZITADEL_EVENTSTORE_HOST=db - ZITADEL_EVENTSTORE_HOST=db
command: [ "-setup-files=cmd/zitadel/setup.yaml", "-setup-files=cmd/zitadel/system-defaults.yaml", "-setup-files=cmd/zitadel/authz.yaml", "setup" ] command:
[
'-setup-files=cmd/zitadel/setup.yaml',
'-setup-files=cmd/zitadel/system-defaults.yaml',
'-setup-files=cmd/zitadel/authz.yaml',
'setup',
]
backend-run: backend-run:
profiles: ["backend"] profiles: ['backend']
restart: on-failure restart: on-failure
networks: networks:
- zitadel - zitadel
depends_on: depends_on:
- db - db
- minio
build: build:
context: ../.. context: ../..
dockerfile: build/dockerfile dockerfile: build/dockerfile
@ -84,15 +111,23 @@ services:
- ../../.keys:/go/src/github.com/caos/zitadel/.keys - ../../.keys:/go/src/github.com/caos/zitadel/.keys
env_file: env_file:
- ./local.env - ./local.env
environment: environment:
- ZITADEL_EVENTSTORE_HOST=db - ZITADEL_EVENTSTORE_HOST=db
ports: ports:
- 50002:50002 - 50002:50002
- 50003:50003 - 50003:50003
command: [ "-console=false", "-localDevMode=true", "-config-files=cmd/zitadel/startup.yaml", "-config-files=cmd/zitadel/system-defaults.yaml", "-config-files=cmd/zitadel/authz.yaml", "start" ] command:
[
'-console=false',
'-localDevMode=true',
'-config-files=cmd/zitadel/startup.yaml',
'-config-files=cmd/zitadel/system-defaults.yaml',
'-config-files=cmd/zitadel/authz.yaml',
'start',
]
zitadel-setted-up: zitadel-setted-up:
profiles: ["setup"] profiles: ['setup']
networks: networks:
- zitadel - zitadel
build: build:
@ -105,7 +140,7 @@ services:
- FE_PORT=4200 - FE_PORT=4200
grpc-web-gateway: grpc-web-gateway:
profiles: ["frontend"] profiles: ['frontend']
restart: on-failure restart: on-failure
logging: logging:
driver: none driver: none
@ -116,13 +151,13 @@ services:
dockerfile: build/local/Dockerfile.gateway dockerfile: build/local/Dockerfile.gateway
image: grpcweb/grpcwebproxy image: grpcweb/grpcwebproxy
ports: ports:
- "50000:8080" - '50000:8080'
environment: environment:
- BKD_HOST=backend-run - BKD_HOST=backend-run
- BKD_PORT=50001 - BKD_PORT=50001
frontend-local-run: frontend-local-run:
profiles: ["frontend"] profiles: ['frontend']
networks: networks:
- zitadel - zitadel
depends_on: depends_on:
@ -140,7 +175,7 @@ services:
- 4200:4200 - 4200:4200
client-id: client-id:
profiles: ["init-frontend"] profiles: ['init-frontend']
networks: networks:
- zitadel - zitadel
build: build:
@ -154,4 +189,4 @@ services:
- PORT=50002 - PORT=50002
networks: networks:
zitadel: {} zitadel: {}

View File

@ -59,3 +59,10 @@ ZITADEL_CONSOLE_GRANT_TYPE=AUTHORIZATION_CODE
ZITADEL_CONSOLE_DEV_MODE=true ZITADEL_CONSOLE_DEV_MODE=true
ZITADEL_CONSOLE_ENV_DIR=console/src/assets/ ZITADEL_CONSOLE_ENV_DIR=console/src/assets/
#minio configuration
ZITADEL_ASSET_STORAGE_ACCESS_KEY_ID=access_key
ZITADEL_ASSET_STORAGE_SECRET_ACCESS_KEY=secret_key
ZITADEL_ASSET_STORAGE_TYPE=s3
ZITADEL_ASSET_STORAGE_ENDPOINT=minio:9000
ZITADEL_ASSET_STORAGE_BUCKET_PREFIX=local