unofficial image for https://github.com/autobcb/read
6.7K
The core application is a Java program (read.jar) that appears to be a web service or application. The use of the Solon framework suggests a focus on being lightweight and high-performing.
The application's configuration is managed dynamically through a docker-entrypoint.sh script. This script's primary role is to generate a conf.yml file based on environment variables if an external configuration file is not mounted.
It is IMPORTANT to note that if you mount an external configuration file at /app/conf.yml, the docker-entrypoint.sh script will use it directly, and the environment variables related to the application's configuration will be ignored.
These variables control the database connection. The application defaults to SQLite if DB_TYPE is not set to mysql.
| Variable | Description | Default Value |
|---|---|---|
DB_TYPE | Specifies the database type. Set to mysql to use MySQL. | (none, defaults to SQLite) |
DB_HOST | The hostname or IP of the MySQL server. | 127.0.0.1 |
DB_PORT | The port for the MySQL server. | 3306 |
DB_DATABASE | The name of the database to use. | (none) |
DB_USERNAME | The username for the database connection. | (none) |
DB_PASSWORD | The password for the database connection. | (none) |
This configuration block is only added if CACHE_DRIVERTYPE is set to redis.
| Variable | Description | Default Value |
|---|---|---|
CACHE_DRIVERTYPE | The cache driver to use. Set to redis to enable Redis. | (none) |
CACHE_KEYHEADER | A prefix for all cache keys stored in Redis. | read |
CACHE_DEFSECONDS | The default cache expiration time in seconds. | 600 |
CACHE_SERVER | The Redis server address (e.g., redis:6379). | localhost:6379 |
CACHE_PASSWORD | The Redis database password. | (none) |
CACHE_DB | The Redis database number to connect to. | 0 |
CACHE_IDELCONNECTIONTIMEOUT | The idle connection timeout for Redis in milliseconds. | 10000 |
CACHE_CONNECTTIMEOUT | The connection timeout for Redis in milliseconds. | 10000 |
These variables control administrative access and default user permissions.
| Variable | Description | Default Value |
|---|---|---|
ADMIN_USERNAME | The username for the application's admin account. | admin |
ADMIN_PASSWORD | The password for the application's admin account. | adminadmin |
ADMIN_CODE | The code for the application's invitation code parameter. | invite |
USER_ALLOWUPTXT | Whether to allow users to upload text (true/false). | false |
USER_ALLOWCACHE | Whether to allow users to use the cache feature (true/false). | false |
USER_ALLOWIMG | Whether to allow users to upload images (true/false). | false |
USER_ALLOWCHECK | Whether to enable a check feature for users (true/false). | false |
USER_SOURCE | A user source setting (numeric). | 0 |
USER_MAXSOURCE | A maximum user source setting (numeric). | 0 |
USER_TIMEOUT | A timeout setting for users (numeric). | 0 |
These variables are for configuring an SMTP server to send emails.
| Variable | Description | Default Value |
|---|---|---|
SMTP_HOST | The SMTP server hostname. | (none) |
SMTP_PROTOCOL | The protocol to use for SMTP (e.g., TLSv1.2). | TLSv1.2 |
SMTP_PORT | The SMTP server port. | (none) |
SMTP_ACCOUNT | The username for the SMTP account. | (none) |
SMTP_PASSWORD | The password for the SMTP account. | (none) |
SMTP_PERSONAL | The "From" name displayed in sent emails. | (none) |
SMTP_CODESUBJECT | The subject line for verification code emails. | 验证码 (Verification Code) |
SMTP_CODETEXT | The body text for verification code emails. | 您的验证码是$code... |
Miscellaneous application and server performance settings.
| Variable | Description | Default Value |
|---|---|---|
DEFAULT_TTS | A default Text-to-Speech (TTS) setting. | (none) |
DEFAULT_RULE | A default rule setting. | (none) |
SERVER_HTTP_CORETHREADS | The number of core threads for the HTTP server. | x5 |
SERVER_HTTP_MAXTHREADS | The maximum number of threads for the HTTP server. | x10 |
These variables configure the Java runtime to use an HTTP/S proxy and are used directly in the java command.
| Variable | Description | Default Value |
|---|---|---|
PROXY_HOST | The hostname or IP of the proxy server. | (none) |
PROXY_PORT | The port of the proxy server. | (none) |
docker-compose.yaml
version: '3.8'
services:
# The Read application service
app:
image: mountaincnc/read:2.18.1
restart: unless-stopped
ports:
- "127.0.0.1:18888:8080"
# Set the environment variables needed by the entrypoint script
environment:
# --- Set up timezone ---
- TZ=Asia/Shanghai
# --- Database Configuration ---
- DB_TYPE=mysql
- DB_HOST=db
- DB_PORT=3306
- DB_DATABASE=read_db
- DB_USERNAME=read_user
- DB_PASSWORD=read_password
# --- Cache Configuration ---
- CACHE_DRIVERTYPE=redis
- CACHE_SERVER=redis:6379
# --- Admin User Configuration ---
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=chang_admin_password
- ADMIN_CODE=invite_code
# IMPORTANT: The mounted external configure file take precedence over environment variables!!!
#volumes:
# - ./config.yaml:/app/conf.yml
# This ensures that the database and cache are started before the app starts
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
# Connect this service to our custom network
networks:
- read-network
# The MySQL database service
db:
# Use an official MySQL image
image: mysql:8.0
restart: unless-stopped
# Environment variables to initialize the MySQL database
environment:
# --- Set up timezone ---
- TZ=Asia/Shanghai
# This sets the root password for the MySQL server
- MYSQL_ROOT_PASSWORD=very_strong_root_password
# This creates the database for the application
- MYSQL_DATABASE=read_db
# This creates a dedicated user for the application
- MYSQL_USER=read_user
# This sets the password for the dedicated user
- MYSQL_PASSWORD=read_password
# Use a named volume to persist the database data
volumes:
- mysql-data:/var/lib/mysql
# Healthcheck to ensure the database is ready for connections before dependent services start
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-pvery_strong_root_password"]
interval: 10s
timeout: 5s
retries: 5
networks:
- read-network
# The Redis cache service
redis:
# Use a lightweight official Redis image
image: redis:7-alpine
restart: unless-stopped
environment:
# --- Set up timezone ---
- TZ=Asia/Shanghai
# Use a named volume to persist Redis data (optional but good practice)
volumes:
- redis-data:/data
networks:
- read-network
# Top-level declaration for named volumes
volumes:
mysql-data:
redis-data:
# Top-level declaration for the custom network
networks:
read-network:
driver: bridge
docker-compose.yaml
version: '3.8'
services:
# The Read application service
app:
image: mountaincnc/read:2.18.1
restart: unless-stopped
ports:
- "127.0.0.1:18888:8080"
# Set the environment variables needed by the entrypoint script
environment:
# --- Set up timezone ---
- TZ=Asia/Shanghai
# --- Admin User Configuration ---
- ADMIN_USERNAME=admin
- ADMIN_PASSWORD=chang_admin_password
volumes:
- sqlite-data:/app/data
# Connect this service to our custom network
networks:
- read-network
volumes:
sqlite-data:
# Top-level declaration for the custom network
networks:
read-network:
driver: bridge
YOUR_DOMAIN {
reverse_proxy 127.0.0.1:18888
}
server {
listen [::]:80;
server_name your.example.com example.com;
location / {
# Replace with the port your application is running on
proxy_pass http://127.0.0.1:18888;
# Standard proxy headers
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebSocket specific headers
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Content type
Image
Digest
sha256:75811e182…
Size
349.8 MB
Last updated
6 months ago
docker pull mountaincnc/read