|
1 | 1 | # seafile-docker |
2 | 2 | Seafile docker image for swift setup |
3 | 3 |
|
4 | | -## Getting started (docker-compose setup) |
5 | | -* prepare docker-compose.yml (see example below) |
6 | | -* start the system with `docker-compose up -d` |
7 | | -* see `docker-compose logs mysql` to find out mysql root password (if you did not set it in docker-compose.override.yml) |
8 | | -* perform initial setup with `docker-compose exec seafile setup` (this will ask you for mysql root password) |
| 4 | +## Quickstart |
9 | 5 |
|
10 | | -## docker-compose.yml example |
11 | | -``` |
12 | | -version: '2' |
| 6 | +* Write the following `docker-compose.yml` configuration. You should change environment variables as needed. |
13 | 7 |
|
| 8 | +``` |
| 9 | +version: '2.2' |
14 | 10 | services: |
15 | 11 | seafile: |
16 | 12 | image: foxel/seafile:6.3.3 |
17 | 13 | ports: |
18 | 14 | - "9080:80" |
19 | 15 | environment: |
| 16 | + MYSQL_ROOT_PASSWORD: 'my-root-secret' |
| 17 | + ADMIN_EMAIL: 'admin@example.com' |
| 18 | + ADMIN_PASSWORD: 'admin' |
20 | 19 | SEAFILE_URL: 'http://seafile.example.com' |
21 | | - links: |
22 | | - - mysql |
23 | 20 | volumes: |
24 | 21 | - seafile:/seafile |
25 | 22 | mysql: |
26 | 23 | environment: |
27 | | - MYSQL_RANDOM_ROOT_PASSWORD: 1 |
| 24 | + MYSQL_ROOT_PASSWORD: 'my-root-secret' |
28 | 25 | volumes: |
29 | 26 | - mysql:/var/lib/mysql |
30 | 27 | image: mysql:5.7 |
31 | | -
|
32 | 28 | volumes: |
33 | | - mysql: |
34 | | - driver: local |
| 29 | + mysql: ~ |
| 30 | + seafile: ~ |
| 31 | +``` |
| 32 | + |
| 33 | +* Start the services with `docker-compose up -d` |
| 34 | + |
| 35 | +* Connect to http://localhost:9080 and login with provided `ADMIN_EMAIL` and `ADMIN_PASSWORD` values. |
| 36 | + |
| 37 | +## Without sensitive environment variables |
| 38 | + |
| 39 | +If you mind using variables containing passwords, you can install seafile in two steps. |
| 40 | + |
| 41 | +* Write the following `docker-compose.yml` configuration. |
| 42 | + |
| 43 | +``` |
| 44 | +version: '2.2' |
| 45 | +services: |
35 | 46 | seafile: |
36 | | - driver: local |
| 47 | + image: foxel/seafile:6.3.3 |
| 48 | + ports: |
| 49 | + - "9080:80" |
| 50 | + environment: |
| 51 | + SEAFILE_URL: 'http://seafile.example.com' |
| 52 | + volumes: |
| 53 | + - seafile:/seafile |
| 54 | + mysql: |
| 55 | + volumes: |
| 56 | + - mysql:/var/lib/mysql |
| 57 | + image: mysql:5.7 |
| 58 | +volumes: |
| 59 | + mysql: ~ |
| 60 | + seafile: ~ |
| 61 | +``` |
| 62 | + |
| 63 | +* Start the services with `docker-compose up -d` |
| 64 | + |
| 65 | +* Check the generated mysql root password in docker logs |
| 66 | + |
| 67 | +``` |
| 68 | +docker-compose logs mysql |
| 69 | +``` |
| 70 | + |
| 71 | +* Run seafile setup by providing variables for the setup execution only. |
| 72 | + |
| 73 | +``` |
| 74 | +docker-compose exec \ |
| 75 | + -e MYSQL_ROOT_PASSWORD="mysql-generated-password" \ |
| 76 | + -e ADMIN_EMAIL="admin@example.com" \ |
| 77 | + -e ADMIN_PASSWORD="admin" \ |
| 78 | + seafile setup |
37 | 79 | ``` |
38 | 80 |
|
| 81 | +* Connect to http://localhost:9080 and login with provided `ADMIN_EMAIL` and `ADMIN_PASSWORD` values. |
| 82 | + |
| 83 | +## Environment variables |
| 84 | + |
| 85 | +- `MYSQL_ROOT_PASSWORD` (or `MYSQL_ROOT_PASSWD`) |
| 86 | + |
| 87 | +Root password of the mysql database used during setup. |
| 88 | + |
| 89 | +- `MYSQL_HOST` (default: `mysql`) |
| 90 | + |
| 91 | +Docker service name of the mysql database. |
| 92 | + |
| 93 | +- `ADMIN_EMAIL` (default: `admin@example.com`) |
| 94 | + |
| 95 | +Default admin user email created during setup. |
| 96 | + |
| 97 | +- `ADMIN_PASSWORD` (default: `admin`) |
| 98 | + |
| 99 | +Default admin password created during setup. |
| 100 | + |
| 101 | +- `USE_EXISTING_DB` (default: `0`) |
| 102 | + |
| 103 | +Set to `1` if database already exists. This will create databases by default. |
| 104 | + |
| 105 | +- `SERVER_NAME` (default: `seafile`) |
| 106 | + |
| 107 | +Name of the seafile server. |
| 108 | + |
| 109 | +- `CCNET_DB` (default: `ccnet-db`) |
| 110 | + |
| 111 | +Ccnet database name. |
| 112 | + |
| 113 | +- `SEAFILE_DB` (default: `seafile-db`) |
| 114 | + |
| 115 | +Seafile database name. |
| 116 | + |
| 117 | +- `SEAHUB_DB` (default: `seahub-db`) |
| 118 | + |
| 119 | +Seahub database name. |
| 120 | + |
39 | 121 | ## UPGRADING |
40 | 122 |
|
41 | 123 | Upgrading is possible in step-by-step manner: |
|
0 commit comments