Yes, the Label Studio 1.15.0 Docker image might work with a secure (SSL) connection to a private Cloud SQL instance, but the functionality you are asking about is more relevant to the enterprise version of LSE, and we have not tested or designed it for the open-source version. There are two common approaches:
Using Cloud SQL Proxy (Recommended):
When running on Cloud Run, it’s common to deploy the Cloud SQL Proxy as a sidecar or include it within your container. The proxy handles the SSL‐certificate management and secure connection details, so your Label Studio container can simply connect to a local proxy endpoint without extra SSL settings. This avoids the need to manually mount the certificates or modify your DATABASE_URL with SSL parameters.
Direct SSL Configuration:
If you prefer to connect directly (without using the Cloud SQL Proxy), you must:
Mount the necessary certificates (e.g., the server CA, client certificate, and client key) into your container (via volumes or secrets).
Set up your environment variables appropriately. For example, your DATABASE_URL could include query parameters such as:
Alternatively, you can also set:
* DATABASE_SSLMODE=require (or verify-full if you want strict verification),
* DATABASE_SSLROOTCERT to point to your CA certificate,
* DATABASE_SSLCERT for your client certificate, and
* DATABASE_SSLKEY for your client key.This direct SSL method works if all certificate files are reachable inside your Cloud Run container and your Cloud SQL instance is configured to require trusted client certificates.
In our deployments, using the Cloud SQL Proxy is usually the “workaround of choice” since it simplifies the secure connection process and avoids potential pitfalls with direct SSL configuration.
For more details on securing Label Studio and connecting it to external databases, please see the security documentation: