Deploying with Docker Compose
Before proceeding, we recommend reading the Introduction, which can quickly help you understand Ikaros.
Setting Up the Environment
- Docker Installation Guide: https://docs.docker.com/engine/install/
- Docker Compose Installation Guide: https://docs.docker.com/compose/install/
We recommend installing Docker and Docker Compose following the official Docker documentation, as the Docker version in the software repositories of some Linux distributions may be outdated.
Creating Container Group
Available Docker images for Ikaros:
Currently, Ikaros has not updated the Docker image with the latest
tag, mainly because no official version has been released yet. We recommend using specific version tags, such as ikarosrun/ikaros:v0.11.5
.
ikarosrun/ikaros:v0.11.5
: Represents the latest available image. A new image is built for each release based on GitHub tags.ikarosrun/ikaros:dev
: Represents the image in development. It is not recommended for use, as it is rebuilt and overwritten with each merged Pull Request into the main branch.
Subsequent documentation will use ikarosrun/ikaros:v0.11.5
as an example.
Create a folder anywhere in the system. This document uses
~/ikaros
as an example.mkdir ~/ikaros && cd ~/ikaros
infoNote: In subsequent operations, all data generated by Ikaros will be saved in this directory. Please keep it safe.
Create
docker-compose.yaml
This document provides Docker Compose configuration files for two scenarios. Please choose one based on your needs.
Create an instance of Ikaros + PostgreSQL:
~/ikaros/docker-compose.yamlversion: "3"
services:
# ikaros
ikaros:
image: ikarosrun/ikaros:v0.11.5
container_name: ikaros
restart: on-failure:3
depends_on:
ikaros_database:
condition: service_healthy
networks:
ikaros_networks:
volumes:
- ./:/root/.ikaros
ports:
- "9999:9999"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9999/actuator/health"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
environment:
- LANG=C.UTF-8
- LC_ALL=C.UTF-8
- TZ=Asia/Shanghai
command:
- --logging.charset.console=UTF-8
- --logging.charset.file=UTF-8
# log level for package, such as INFO or DEBUG
- --logging.level.run.ikaros.server=INFO
- --logging.level.run.ikaros.plugin=INFO
- --logging.level.run.ikaros.jellyfin=INFO
- --sun.jnu.encoding=UTF-8
- --spring.r2dbc.url=r2dbc:pool:postgresql://ikaros_database/ikaros
- --spring.r2dbc.username=ikaros
# Make sure the password for PostgreSQL matches the value of the POSTGRES_PASSWORD variable below.
- --spring.r2dbc.password=openpostgresql
- --spring.sql.init.platform=postgresql
# Initial superuser username
- --ikaros.security.initializer.master-username=tomoki
# Initial superuser password
- --ikaros.security.initializer.master-password=tomoki
# ikaros database
ikaros_database:
image: postgres:latest
container_name: ikaros_database
restart: on-failure:3
networks:
ikaros_networks:
volumes:
- ./database:/var/lib/postgresql/data
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_DB=ikaros
- POSTGRES_USER=ikaros
- POSTGRES_PASSWORD=openpostgresql
networks:
ikaros_networks:
driver: bridgeCreate Ikaros instance only (using the default H2 database, not recommended for production environment, suggested for experience and testing only):
~/ikaros/docker-compose.yamlversion: "3"
services:
# ikaros
ikaros:
image: ikarosrun/ikaros:v0.11.5
container_name: ikaros
restart: on-failure:3
networks:
ikaros_networks:
volumes:
- ./:/root/.ikaros
ports:
- "9999:9999"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9999/actuator/health"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
environment:
- LANG=C.UTF-8
- LC_ALL=C.UTF-8
- TZ=Asia/Shanghai
command:
- --logging.charset.console=UTF-8
- --logging.charset.file=UTF-8
- --logging.level.run.ikaros.server=INFO
- --logging.level.run.ikaros.plugin=INFO
- --logging.level.run.ikaros.jellyfin=INFO
- --sun.jnu.encoding=UTF-8
# Initial superuser username
- --ikaros.security.initializer.master-username=tomoki
# Initial superuser password
- --ikaros.security.initializer.master-password=tomoki
networks:
ikaros_networks:
driver: bridge
Parameter Details:
Parameter Name Description spring.r2dbc.url
Database connection URL, see Database Configuration
below for detailsspring.r2dbc.username
Database username spring.r2dbc.password
Database password spring.sql.init.platform
Database platform name, supports postgresql
,h2
ikaros.security.initializer.master-username
Initial superuser username, default tomoki
ikaros.security.initializer.master-password
Initial superuser password, the first run of the program is printed in the log. Database Configuration:
Connection Method Connection Address Format spring.sql.init.platform
PostgreSQL r2dbc:pool:postgresql://{HOST}:{PORT}/{DATABASE}
postgresql H2 Database r2dbc:h2:file:///${ikaros.work-dir}/db/ikaros?MODE=MySQL&DB_CLOSE_ON_EXIT=FALSE
h2 Start the Ikaros service
docker-compose up -d
View logs in real-time:
docker-compose logs -f ikaros
Access the Ikaros management page by visiting
/console
in your browser. The username and password are the ones set in thedocker-compose.yaml
file asmaster-username
andmaster-password
.
If not started with these parameters, the default username is tomoki
, and the password will be printed in the logs (printed only on the first run).
Updating Container Group
Stop the running container group.
cd ~/ikaros && docker-compose down
Backup Data (Important)
cp -r ~/ikaros ~/ikaros.archive
It's worth noting that the
ikaros.archive
filename doesn't necessarily have to follow the naming convention in this document. This is just an example.
Update the Ikaros service
Modify the image version configured in
docker-compose.yaml
.services:
ikaros:
image: ikarosrun/ikaros:v0.11.5
container_name: ikarosdocker-compose pull ikaros
docker-compose up -d