You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/04/28 21:54:56 UTC
[GitHub] [airflow] dinigo edited a comment on issue #8606: Deal with initial username/passwords in the production docker image
dinigo edited a comment on issue #8606:
URL: https://github.com/apache/airflow/issues/8606#issuecomment-620873030
Well you can simply add a new service in the docker stack/compose to initialize it:
```
version: '3.6'
services:
init:
image: apache/airflow:1.10.10
environment:
AIRFLOW__CORE__SQL_ALCHEMY_CONN: mysql://airflow:airflow@mysql:3306/airflow
entrypoint: "airflow upgradedb && airflow create_user -f none -l none -u $USER -p $PASSWORD -e $EMAIL"
mysql:
image: mysql
environment:
DB_USER: airflow
DB_PASSWORD: airflow
DB_NAME: airflow
```
I think something like this will do. It can be added to the entrypoint script also.
But you can initialize any database with a matching version airflow installation. To initialize my airflow db for the docker stack deployments I do the following
1. Spin up the db
2. Setup the env variables to connect to the DB in local (fernet key and sql_alchemy_conn)
3. Init the db and create user from local environment
4 Deploy the stack with everything initialized
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org