|
| 1 | +--- |
| 2 | +title: Deploying with Docker Compose |
| 3 | +description: Deploying with Docker Compose |
| 4 | +--- |
| 5 | + |
| 6 | +import DockerArgs from "./slots/docker-args.md" |
| 7 | + |
| 8 | +:::info |
| 9 | +Before proceeding, we recommend reading the [Introduction](../prepare.md), which can quickly help you understand Ikaros. |
| 10 | +::: |
| 11 | + |
| 12 | +## Setting Up the Environment |
| 13 | + |
| 14 | +- Docker Installation Guide: <https://docs.docker.com/engine/install/> |
| 15 | +- Docker Compose Installation Guide: <https://docs.docker.com/compose/install/> |
| 16 | + |
| 17 | +:::tip |
| 18 | +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. |
| 19 | +::: |
| 20 | + |
| 21 | +## Creating Container Group |
| 22 | + |
| 23 | +Available Docker images for Ikaros: |
| 24 | + |
| 25 | +- [ikarosrun/ikaros](https://hub.docker.com/r/ikarosrun/ikaros) |
| 26 | + |
| 27 | +:::info Note |
| 28 | +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`. |
| 29 | + |
| 30 | +- `ikarosrun/ikaros:v0.11.5`: Represents the latest available image. A new image is built for each release based on GitHub tags. |
| 31 | +- `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. |
| 32 | + |
| 33 | +Subsequent documentation will use `ikarosrun/ikaros:v0.11.5` as an example. |
| 34 | +::: |
| 35 | + |
| 36 | +1. Create a folder anywhere in the system. This document uses `~/ikaros` as an example. |
| 37 | + |
| 38 | + ```bash |
| 39 | + mkdir ~/ikaros && cd ~/ikaros |
| 40 | + ``` |
| 41 | + :::info |
| 42 | + Note: In subsequent operations, all data generated by Ikaros will be saved in this directory. Please keep it safe. |
| 43 | + ::: |
| 44 | + |
| 45 | +2. Create `docker-compose.yaml` |
| 46 | + |
| 47 | + This document provides Docker Compose configuration files for two scenarios. Please choose one based on your needs. |
| 48 | + |
| 49 | + 1. Create an instance of Ikaros + PostgreSQL: |
| 50 | + |
| 51 | + ```yaml {24-34,51} title="~/ikaros/docker-compose.yaml" |
| 52 | + version: "3" |
| 53 | + services: |
| 54 | + # ikaros |
| 55 | + ikaros: |
| 56 | + image: ikarosrun/ikaros:v0.11.5 |
| 57 | + container_name: ikaros |
| 58 | + restart: on-failure:3 |
| 59 | + depends_on: |
| 60 | + ikaros_database: |
| 61 | + condition: service_healthy |
| 62 | + networks: |
| 63 | + ikaros_networks: |
| 64 | + volumes: |
| 65 | + - ./:/root/.ikaros |
| 66 | + ports: |
| 67 | + - "9999:9999" |
| 68 | + healthcheck: |
| 69 | + test: [ "CMD", "curl", "-f", "http://localhost:9999/actuator/health"] |
| 70 | + interval: 30s |
| 71 | + timeout: 5s |
| 72 | + retries: 5 |
| 73 | + start_period: 30s |
| 74 | + environment: |
| 75 | + - LANG=C.UTF-8 |
| 76 | + - LC_ALL=C.UTF-8 |
| 77 | + - TZ=Asia/Shanghai |
| 78 | + command: |
| 79 | + - --logging.charset.console=UTF-8 |
| 80 | + - --logging.charset.file=UTF-8 |
| 81 | + # log level for package, such as INFO or DEBUG |
| 82 | + - --logging.level.run.ikaros.server=INFO |
| 83 | + - --logging.level.run.ikaros.plugin=INFO |
| 84 | + - --logging.level.run.ikaros.jellyfin=INFO |
| 85 | + - --sun.jnu.encoding=UTF-8 |
| 86 | + - --spring.r2dbc.url=r2dbc:pool:postgresql://ikaros_database/ikaros |
| 87 | + - --spring.r2dbc.username=ikaros |
| 88 | + # Make sure the password for PostgreSQL matches the value of the POSTGRES_PASSWORD variable below. |
| 89 | + - --spring.r2dbc.password=openpostgresql |
| 90 | + - --spring.sql.init.platform=postgresql |
| 91 | + # Initial superuser username |
| 92 | + - --ikaros.security.initializer.master-username=tomoki |
| 93 | + # Initial superuser password |
| 94 | + - --ikaros.security.initializer.master-password=tomoki |
| 95 | + |
| 96 | + # ikaros database |
| 97 | + ikaros_database: |
| 98 | + image: postgres:latest |
| 99 | + container_name: ikaros_database |
| 100 | + restart: on-failure:3 |
| 101 | + networks: |
| 102 | + ikaros_networks: |
| 103 | + volumes: |
| 104 | + - ./database:/var/lib/postgresql/data |
| 105 | + healthcheck: |
| 106 | + test: [ "CMD", "pg_isready" ] |
| 107 | + interval: 10s |
| 108 | + timeout: 5s |
| 109 | + retries: 5 |
| 110 | + environment: |
| 111 | + - POSTGRES_DB=ikaros |
| 112 | + - POSTGRES_USER=ikaros |
| 113 | + - POSTGRES_PASSWORD=openpostgresql |
| 114 | + |
| 115 | + networks: |
| 116 | + ikaros_networks: |
| 117 | + driver: bridge |
| 118 | + ``` |
| 119 | + |
| 120 | + 2. Create Ikaros instance only (using the default H2 database, **not recommended for production environment, suggested for experience and testing only**): |
| 121 | + |
| 122 | + ```yaml {19-24} title="~/ikaros/docker-compose.yaml" |
| 123 | + version: "3" |
| 124 | + services: |
| 125 | + # ikaros |
| 126 | + ikaros: |
| 127 | + image: ikarosrun/ikaros:v0.11.5 |
| 128 | + container_name: ikaros |
| 129 | + restart: on-failure:3 |
| 130 | + networks: |
| 131 | + ikaros_networks: |
| 132 | + volumes: |
| 133 | + - ./:/root/.ikaros |
| 134 | + ports: |
| 135 | + - "9999:9999" |
| 136 | + healthcheck: |
| 137 | + test: [ "CMD", "curl", "-f", "http://localhost:9999/actuator/health"] |
| 138 | + interval: 30s |
| 139 | + timeout: 5s |
| 140 | + retries: 5 |
| 141 | + start_period: 30s |
| 142 | + environment: |
| 143 | + - LANG=C.UTF-8 |
| 144 | + - LC_ALL=C.UTF-8 |
| 145 | + - TZ=Asia/Shanghai |
| 146 | + command: |
| 147 | + - --logging.charset.console=UTF-8 |
| 148 | + - --logging.charset.file=UTF-8 |
| 149 | + - --logging.level.run.ikaros.server=INFO |
| 150 | + - --logging.level.run.ikaros.plugin=INFO |
| 151 | + - --logging.level.run.ikaros.jellyfin=INFO |
| 152 | + - --sun.jnu.encoding=UTF-8 |
| 153 | + # Initial superuser username |
| 154 | + - --ikaros.security.initializer.master-username=tomoki |
| 155 | + # Initial superuser password |
| 156 | + - --ikaros.security.initializer.master-password=tomoki |
| 157 | + |
| 158 | + networks: |
| 159 | + ikaros_networks: |
| 160 | + driver: bridge |
| 161 | + ``` |
| 162 | + |
| 163 | + Parameter Details: |
| 164 | + |
| 165 | + <DockerArgs /> |
| 166 | + |
| 167 | +3. Start the Ikaros service |
| 168 | + |
| 169 | + ```bash |
| 170 | + docker-compose up -d |
| 171 | + ``` |
| 172 | + |
| 173 | + View logs in real-time: |
| 174 | + |
| 175 | + ```bash |
| 176 | + docker-compose logs -f ikaros |
| 177 | + ``` |
| 178 | + |
| 179 | +4. Access the Ikaros management page by visiting `/console` in your browser. The username and password are the ones set in the `docker-compose.yaml` file as `master-username` and `master-password`. |
| 180 | + |
| 181 | +:::tip |
| 182 | +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). |
| 183 | +::: |
| 184 | + |
| 185 | +## Updating Container Group |
| 186 | + |
| 187 | +1. Stop the running container group. |
| 188 | + |
| 189 | + ```bash |
| 190 | + cd ~/ikaros && docker-compose down |
| 191 | + ``` |
| 192 | + |
| 193 | +2. Backup Data (Important) |
| 194 | + |
| 195 | + ```bash |
| 196 | + cp -r ~/ikaros ~/ikaros.archive |
| 197 | + ``` |
| 198 | + |
| 199 | + > 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. |
| 200 | +
|
| 201 | + |
| 202 | +3. Update the Ikaros service |
| 203 | + |
| 204 | + Modify the image version configured in `docker-compose.yaml`. |
| 205 | + |
| 206 | + ```yaml {3} |
| 207 | + services: |
| 208 | + ikaros: |
| 209 | + image: ikarosrun/ikaros:v0.11.5 |
| 210 | + container_name: ikaros |
| 211 | + ``` |
| 212 | +
|
| 213 | + ```bash |
| 214 | + docker-compose pull ikaros |
| 215 | + ``` |
| 216 | + |
| 217 | + ```bash |
| 218 | + docker-compose up -d |
| 219 | + ``` |
0 commit comments