You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to have a command that would migrate then run the docker container so that a separate container isn't needed purely for migration.
I have multiple docker-compose.yml files that utilise the extends property however this can't be used with containers in other files that use the depend_on: property. The openfga container depend_on the migrate container in the setup guides.
Having a single migrate container exited also changes the status in docker compose deployment to yellow instead of green which means other docker deployments aren't triggered correctly when chained together. e.g. status = Running (1/2)
Describe the ideal solution
It would be so much cleaner and allow for better docker file structuring if we had the optional ability to run migrations before the run command in the main openfga container.
This could be done by adding a new command or testing a boolean env var
run-with-migration = migrate && run
or
RUN_MIGRATIONS=true
openfga:
depends_on:
migrate:
condition: service_completed_successfullyimage: openfga/openfga:latestcontainer_name: openfgaenvironment:
- OPENFGA_DATASTORE_ENGINE=postgres
- OPENFGA_DATASTORE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_DB}:5432/openfga?sslmode=disable
- OPENFGA_LOG_FORMAT=json
- RUN_MIGRATIONS=truecommand: run-with-migrationnetworks:
- openfga-networkports:
# Needed for the http server
- '8080:8080'# Needed for the grpc server (if used)
- '8081:8081'# Needed for the playground (Do not enable in prod!)
- '3000:3000'
Alternatives and current workarounds
I tried many combinations for running two command in the container including below however they did not work
command:
- migrate
- run
command: > bash -c "migrate && run"
Additional context
No response
The text was updated successfully, but these errors were encountered:
Checklist
Describe the problem you'd like to have solved
It would be nice to be able to have a command that would migrate then run the docker container so that a separate container isn't needed purely for migration.
I have multiple docker-compose.yml files that utilise the extends property however this can't be used with containers in other files that use the depend_on: property. The openfga container depend_on the migrate container in the setup guides.
Having a single migrate container exited also changes the status in docker compose deployment to yellow instead of green which means other docker deployments aren't triggered correctly when chained together. e.g. status = Running (1/2)
Describe the ideal solution
It would be so much cleaner and allow for better docker file structuring if we had the optional ability to run migrations before the run command in the main openfga container.
This could be done by adding a new command or testing a boolean env var
run-with-migration = migrate && run
or
RUN_MIGRATIONS=true
Alternatives and current workarounds
I tried many combinations for running two command in the container including below however they did not work
Additional context
No response
The text was updated successfully, but these errors were encountered: