Skip to content

Setup SeaTicket Server

The following assumptions and conventions are used in the rest of this document

  • /opt/seaticket is the directory for store SeaTicket docker compose files. If you decide to put SeaTicket in a different directory — which you can — adjust all paths accordingly.
  • SeaTicket uses some Docker volumes for persisting data generated in its database and SeaTicket Docker container. The volumes' host paths like /opt/caddy-data and /opt/seaticket-data, respectively. It is not recommended to change these paths. If you do, account for it when following these instructions.
  • All configuration and log files for SeaTicket are stored in the volume of the SeaTicket container.
  • SeaTicket contains following components, each packaged as a separate docker image:
  • Caddy and seaqa-web
  • seaqa-ai
  • seaqa-events
  • seaqa-indexer

Getting started

Preparing seaticket_db

Before starting SeaTicket, you need to create a MySQL user (seaticket as the example in this manual) and a database for SeaTicket server (seaticket_db as the example in this manual).

Copy mysql.sql file to the host /tmp directory:

docker run --rm -v /tmp:/shared seaticket/seaqa-web:1.0-latest cp /opt/seaticket/seaqa-web/sql/mysql.sql /shared

Create the MySQL user seaticket and create the database seaticket_db:

mysql -u root -p

# then input the following commands
CREATE DATABASE seaticket_db CHARACTER SET utf8mb4;
CREATE USER seaticket@'%' IDENTIFIED BY <SEAQA_MYSQL_DB_PASSWORD>;
GRANT ALL PRIVILEGES ON seaticket_db.* TO 'seaticket'@'%';
FLUSH PRIVILEGES;

USE seaticket_db;
SOURCE /tmp/mysql.sql;

Download resource files

To deploy SeaTicket with Docker, you have to .env, caddy.yml, seaqa-web.yml, seaqa-indexer.yml, seaqa-ai.yml, seaqa-events.yml, and seaticket_config.yaml in a directory (e.g., /opt/seaticket):

mkdir -p /opt/seaticket/conf
cd /opt/seaticket

wget -O .env https://manual.seaticket.ai/0.9/repo/docker/seaticket/env
wget https://manual.seaticket.ai/0.9/repo/docker/seaticket/caddy.yml
wget https://manual.seaticket.ai/0.9/repo/docker/seaticket/seaqa-web.yml
wget https://manual.seaticket.ai/0.9/repo/docker/seaticket/seaqa-indexer.yml
wget https://manual.seaticket.ai/0.9/repo/docker/seaticket/seaqa-ai.yml
wget https://manual.seaticket.ai/0.9/repo/docker/seaticket/seaqa-events.yml

cd /opt/seaticket/conf
wget https://manual.seaticket.ai/0.9/repo/docker/seaticket/seaticket_config.yaml

Modify .env

The following fields merit particular attention:

Variable Description Default Value
SEATICKET_SERVER_PROTOCOL SeaTicket server protocol (http or https) http
SEATICKET_SERVER_HOSTNAME SeaTicket server hostname or domain (required)
JWT_PRIVATE_KEY JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters is required for SeaTicket, which can be generated by using pwgen -s 40 1 (required)
SECRET_KEY SECRET_KEY, A random string with a length of no less than 32 characters is required for SeaTicket, which can be generated by using pwgen -s 40 1. It cannot be changed after the first generation, so please back it up. (required)
SEADB_SERVER_URL SeaDB server URL http://seadb
SEADB_SERVER_ACCESS_TOEKN Access token for SeaDB server, should be the same as the value in the .env for deploying SeaDB (required)
SEASEARCH_URL Your SeaSearch server API endpoint url, e.g., http://<your seasearch host>:4080 (required)
SEASEARCH_TOKEN Your authorization token for accessing SeaSearch API, which can be constructed in echo -n '<your_seasearch_username>:<your_seasearch_password>' | base64 (required)
SEAQA_MYSQL_DB_HOST The host of MySQL server (required)
SEAQA_MYSQL_DB_PORT The port of MySQL server 3306
SEAQA_MYSQL_DB_USER The user for accessing MySQL server seaticket
SEAQA_MYSQL_DB_PASSWORD The password of MySQL server (none)
REDIS_HOST The host of Redis server (required)
REDIS_PORT The port of Redis server 6379
REDIS_PASSWORD The password of Redis server (none)
S3_HOST S3 storage backend API endpoint URL (e.g., https://s3-endpoint.example.com. For AWS S3, the S3_HOST can be set from https://s3.<region>.amazonaws.com) (required)
S3_KEY_ID S3 storage backend key ID (required)
S3_SECRET_KEY S3 storage backend secret key (required)
S3_FILE_BUCKET Name of the bucket for saving upload files (required)
S3_WEB_CRAWL_BUCKET Name of the bucket for saving web-crawl data (required)
SEAQA_LOG_TO_STDOUT Record logs to container standard output false
TIME_ZONE Timezone of SeaTicket server UTC

Modify seaticket_config.yaml and add LLM models configuration

Please refer here for the details.

Start SeaTicket server

Modify COMPOSE_FILE in .env file:

COMPOSE_FILE='caddy.yml,seaqa-web.yml'

Start SeaTicket server with the following command

docker compose up -d

Add admin account

docker exec -it seaqa-web /scripts/reset-admin.sh

Enter the username and password according to the prompts. You now have a new admin account.

Finally, you can go to http://seaticket.example.com to use SeaTicket.

Deploy other components

You can deploy other components of SeaTicket, such as seaqa-ai, seaqa-events, seaqa-indexer.

Copy /opt/seaticket to other machines.

Modify COMPOSE_FILE in .env file:

COMPOSE_FILE='seaqa-ai.yml'

Start server with the following command

docker compose up -d

SeaTicket directory structure

Placeholder spot for shared volumes. You may elect to store certain persistent information outside of a container, in our case we keep various log files and upload directory outside. This allows you to rebuild containers easily without losing important information.

Path /opt/seadb-data

  • /opt/seadb-data: This is the directory for seaticket server configuration and data.
    • /opt/seaticket-data/logs: This is the directory that would contain the log files of seaticket server processes. For example, you can find seadb logs in /opt/seadb/logs/seadb.log.

Path /opt/seaticket-data

  • /opt/seaticket-data: This is the directory for seaticket server configuration and data.
    • /opt/seaticket-data/logs: This is the directory that would contain the log files of seaticket server processes. For example, you can find seaqa-web logs in /opt/seaticket/logs/seaqa-web.log.
    • /opt/seaticket-data/seaqa-web-data: This is the directory that would contain the avatar files of seaticket server processes.

Find logs

To monitor container logs (from outside of the container), please use the following commands:

# if the `.env` file is in current directory:
docker compose logs --follow
# if the `.env` file is elsewhere:
docker compose --env-file /path/to/.env logs --follow

# you can also specify container name:
docker compose logs seaqa-web --follow
# or, if the `.env` file is elsewhere:
docker compose --env-file /path/to/.env logs seaqa-web --follow

The SeaTicket logs are under /shared/logs in the docker, or /opt/seaticket/logs in the server that run the docker.

To monitor all SeaTicket logs simultaneously (from outside of the container), run

sudo tail -f $(find /opt/seaticket/logs/ -type f -name *.log 2>/dev/null)