Sign inSign up

supertokens/supertokens-sqlite

By supertokens

•Updated almost 6 years ago

Image
0

1.9K

supertokens/supertokens-sqlite repository overview

⁠Quickstart

# This will start with an in memory database.

$ docker run -p 3567:3567 -d supertokens/supertokens-sqlite

⁠Configuration

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.

⁠Using environment variable

Available environment variables

  • Core [click for more info⁠]
    • API_KEYS
    • COOKIE_DOMAIN
    • REFRESH_API_PATH
    • SUPERTOKENS_HOST
    • SUPERTOKENS_PORT
    • ACCESS_TOKEN_VALIDITY
    • ACCESS_TOKEN_BLACKLISTING
    • ACCESS_TOKEN_PATH
    • ACCESS_TOKEN_SIGNING_KEY_DYNAMIC
    • ACCESS_TOKEN_SIGNING_KEY_UPDATE_INTERVAL
    • ENABLE_ANTI_CSRF
    • REFRESH_TOKEN_VALIDITY
    • INFO_LOG_PATH
    • ERROR_LOG_PATH
    • COOKIE_SECURE
    • SESSION_EXPIRED_STATUS_CODE
    • COOKIE_SAME_SITE
    • MAX_SERVER_POOL_SIZE
  • SQLITE: [click for more info⁠]
    • SQLITE_CONNECTION_POOL_SIZE
    • SQLITE_DATABASE_NAME
    • SQLITE_KEY_VALUE_TABLE_NAME
    • SQLITE_SESSION_INFO_TABLE_NAME
$ docker run \
	-p 3567:3567 \
	-v /path/to/sqlite_data:/sqlite_db \
	-d supertokens/supertokens-sqlite
⁠Using custom config file
  • In your config.yaml file, please make sure you store the following key / values:
    • core_config_version: 0
    • host: "0.0.0.0"
    • sqlite_config_version: 0
    • sqlite_database_folder_location: "/sqlite_db"
    • info_log_path: null (to log in docker logs)
    • error_log_path: null (to log in docker logs)
  • The path for the 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 \
	-v /path/to/sqlite_data:/sqlite_db \
	-d supertokens/supertokens-sqlite

⁠Logging

  • By default, all the logs will be available via the docker logs <container-name> command.
  • You can setup logging to a shared volume by:
    • Setting the info_log_path and error_log_path variables in your config.yaml file (or passing the values asn env variables).
    • Mounting the shared volume for the logging directory.
$ 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 \
	-v /path/to/sqlite_data:/sqlite_db \
	-d supertokens/supertokens-sqlite

⁠Database storage

The docker container stores SQLite data in /sqlite_db folder. You can mount a shared volume at that path to persist data across docker restarts.

⁠CLI reference

Please refer to our documentation⁠ for this.

Tag summary

Content type

Image

Digest

Size

83.7 MB

Last updated

almost 6 years ago

docker pull supertokens/supertokens-sqlite