I have an gcloud app configured to use the Cloud SQL instance in app.yaml:
beta_settings:
cloud_sql_instances: <instance-name>
After I deploy the app, /cloudsql/<instance-name>
is available and it is possible to connect to the database through the socket file.
In order to migrate the database schema with each deployment I need a deployment command in Dockerfile
:
RUN yarn run sequelize db:migrate
However the /cloudsql
is not available when Dockerfile
is executed.
RUN ls /cloudsql
leads to ls: /cloudsql: No such file or directory
.
What is a way to make /cloudsql
available in this context?
Is there other best practice to migrate the database in gcloud deployment?