Traccar with built in Google Cloud SQL drivers
120
Perfect for Cloud Run as the Traccar config file has been replaced with environment variables.
You can simply run the Docker image: inlustra/traccar-google-cloud-sql with the required env vars below.
It will default to the Google Cloud SQL MySQL connector, if you are using MySQL, the only env vars required are:
| Env var | Required | Description |
|---|---|---|
| DATABASE_USERNAME | ✓ | Cloud SQL database user |
| DATABASE_PASSWORD | ✓ | Cloud SQL database password |
| DATABASE_NAME | ✓ | Cloud SQL database name |
| CONNECTION_NAME | ✓ | Go to your Cloud SQL page, create a database and copy the 'Connection Name', it looks something like: myproject:mylocation:mydbname |
| DATABASE_TYPE | ✗ | Used to auto configure the advanced variables, supported options are: 'mysql' (Default), 'postgresql' or 'custom' (Advanced) |
| DATABASE_PROTOCOL | ✗ | Advanced, if DATABASE_TYPE is set to custom, used to manually create JDBC url |
| DATABASE_DRIVER | ✗ | Advanced, if DATABASE_TYPE is set to custom, you can only use those drivers supported by Traccar or loaded via DRIVER_FILE |
| DATABASE_SOCKET_FACTORY | ✗ | Advanced, if DATABASE_TYPE is set to custom, allows loading a custom socket factory via JDBC url |
| ENABLE_IAM_AUTH | ✗ | Used to set enableIamAuth on postgresql socket connections |
| JDBC_URL_OPTIONS | ✗ | Advanced, if DATABASE_TYPE is set to custom, You can use this to append to the JDBC URL, the default URL is: 'jdbc:${DATABASE_TYPE}:///${DATABASE_NAME}?socketFactory=${DATABASE_SOCKET_FACTORY}&cloudSqlInstance=${CONNECTION_NAME}&unixSocketPath=/cloudsql/${CONNECTION_NAME}${JDBC_URL_OPTIONS}' |
Content type
Image
Digest
sha256:4cb712d91…
Size
179.4 MB
Last updated
about 4 years ago
docker pull inlustra/traccar-google-cloud-sql:0.0.1