Skip to content

Instantly share code, notes, and snippets.

@nathanfletcher
Created July 20, 2020 14:32
Show Gist options
  • Save nathanfletcher/70057a07d9eb9482fe1cbf377765ec91 to your computer and use it in GitHub Desktop.
Save nathanfletcher/70057a07d9eb9482fe1cbf377765ec91 to your computer and use it in GitHub Desktop.
Strapi database config file for Cloud Run
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'mysql',
socketPath: "/cloudsql/gcloud-project-name:europe-west4:databasename",
database: process.env.DATABASE_NAME || '',
username: process.env.DATABASE_USERNAME || '',
password: process.env.DATABASE_PASSWORD || '',
ssl: false,
},
options: {
pool: {
min: 0,
max: 50,
idleTimeoutMillis: 30000,
createTimeoutMillis: 30000,
acquireTimeoutMillis: 30000
}
}
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment