# This will start with an in memory database.
$ docker run -p 3567:3567 -d registry.supertokens.io/supertokens/supertokens-mysql
You can use your own config.yaml
file as a shared volume or pass the key-values as environment variables.
If you do both, only the shared config.yaml
file will be considered.
Available environment variables
docker run \
-p 3567:3567 \
-e MYSQL_CONNECTION_URI="mysql://username:password@host:port/dbName" \
-d registry.supertokens.io/supertokens/supertokens-mysql
# OR
docker run \
-p 3567:3567 \
-e MYSQL_USER="mysqlUser" \
-e MYSQL_HOST="192.168.1.2" \
-e MYSQL_PORT="3306" \
-e MYSQL_PASSWORD="password" \
-d registry.supertokens.io/supertokens/supertokens-mysql
config.yaml
file, please make sure you store the following key / values:
core_config_version: 0
host: "0.0.0.0"
mysql_config_version: 0
info_log_path: null
(to log in docker logs)error_log_path: null
(to log in docker logs)config.yaml
file in the container is /usr/lib/supertokens/config.yaml
$ docker run \
-p 3567:3567 \
-v /path/to/config.yaml:/usr/lib/supertokens/config.yaml \
-d registry.supertokens.io/supertokens/supertokens-mysql
docker logs <container-name>
command.info_log_path
and error_log_path
variables in your config.yaml
file (or passing the values asn env variables).$ docker run \
-p 3567:3567 \
-v /path/to/logsFolder:/home/logsFolder \
-e INFO_LOG_PATH="/home/logsFolder/info.log" \
-e ERROR_LOG_PATH="/home/logsFolder/error.log" \
-e MYSQL_USER="mysqlUser" \
-e MYSQL_PASSWORD="password" \
-d registry.supertokens.io/supertokens/supertokens-mysql
MYSQL_USER
, MYSQL_PASSWORD
and MYSQL_CONNECTION_URI
are not provided, then SuperTokens will use an in memory database./lib/supertokens/temp/
docker run \
-p 3567:3567 \
--mount source=/path/on/host/machine,destination=/lib/supertokens/temp/,type=bind \
--read-only \
-d registry.supertokens.io/supertokens/supertokens-mysql
docker run \
-p 3567:3567 \
--tmpfs=/lib/supertokens/temp/:exec \
--read-only \
-d registry.supertokens.io/supertokens/supertokens-mysql