Docker Compose deployment
Recommended configuration
Recommended minimum configuration 1 core 2G
If there is only 1 core 1G? Please refer to my blog: Linux small resource server experience summary expand memory space by swapping memory
Memory usage for reference:
Pre-environment
Docker / Docker Compose
First you need to make sure you have a Docker / Docker Compose
environment
The installation method can refer to: Install the docker environment
Pull Image
You can pull the compiled image from public image or manually compile from source code
Using the compiled image can compile without spending enough computer resources, which is very friendly to servers with small resource configurations. In addition, compared to source code compilation, the code of the public image is more stable.
- One-command installation using cli
- Manually install from public image
- Compile from source
Use
cli
Please make sure you already have a node environment on your server (node version 16+ is recommended) If you don't know about node, you can useManually install from public image
Use the command line tool tailchat-cli
to pull/update the image with one click:
npx tailchat-cli docker update
Manually install using Docker native commands:
docker pull moonrailgun/tailchat # Pull the tailchat image from the public image registry
docker tag moonrailgun/tailchat tailchat # Retag the downloaded image to tailchat (consistent with source code compilation, if not changed, it will follow the source code compilation process)
You can view historically supported image versions from Docker Hub
This section is for advanced players to get the latest tailchat implementation, please make sure you have enough knowledge of docker
, nodejs
, git
Compilation environment
- Download from official website
- Or use nvm
Install pnpm
pnpm
is a package management tool for nodejs
, a substitute for npm
, in order to ensure the same dependency environment as developers, it is strongly recommended that you use pnpm as a follow-up package management tool
npm install -g pnpm
Clone Repo
Download the project from remote:
mkdir msgbyte && cd msgbyte
git clone https://github.com/msgbyte/tailchat.git # Clone the project to local
Compile project
cd tailchat && docker compose build
Compilation has certain requirements on server configuration, 2-core 4G compilation takes about 10 minutes, for reference
After the compilation is complete, you can view the compiled image through docker images
.
Startup project
- One-command installation using cli
- Manually install from public image
- Compile from source
npx tailchat-cli docker init
Executing this command will ask you some configuration-related questions in an interactive manner (as shown in the figure below), and the configuration file will be automatically generated after filling it out
A configuration file needs to be downloaded before starting to tell
docker-compose
how to start the image Download configuration files and configure environment variables from the repository:
mkdir tailchat && cd tailchat
wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.yml
wget https://raw.githubusercontent.com/msgbyte/tailchat/master/docker-compose.env
Need to modify the configuration before starting
Modify the configuration of the docker-compose.env
file, the following fields are recommended to be modified:
API_URL
is an externally accessible url address, used for file service access, it can be a domain name or an ip If the sent picture cannot be displayed normally, this variable is not setSECRET
server-side encryption key, used to generate Token. The default istailchat
Need to modify the configuration before starting
Modify the configuration of the docker-compose.env
file, the following fields are recommended to be modified:
API_URL
is an externally accessible url address, used for file service access, it can be a domain name or an ip If the sent picture cannot be displayed normally, this variable is not setSECRET
server-side encryption key, used to generate Token. The default istailchat
After completing the configuration, use docker-compose
to start the Tailchat
application with one click:
# Make sure the configuration files (docker-compose.yml and docker-compose.env) are in the current directory
# Execute the following command to start with one key
docker compose up -d
Visit: http://<server ip>:11000
to open tailchat.
Note that some cloud services may need to manually open firewall ports.
Some environment variables are provided in the docker-compose.env
file for configuration.
The docker-compose.yml
configuration of tailchat
provides the following configuration by default:
mongodb
: Persistent Databaseredis
: KV database and message transport serviceminio
: Distributed file service
The persistent files (database, file storage) are managed uniformly through docker volume
:
docker volume ls | grep "tailchat-server"
Complete environment variables can be queried Environment Variables