Merge pull request #320 from haiwen/config-in-env
Some checks failed
Deploy CI / deploy (push) Has been cancelled

Config in env
This commit is contained in:
Daniel Pan 2024-09-09 13:35:42 +08:00 committed by GitHub
commit 5f4b9e79bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 279 additions and 122 deletions

View File

@ -0,0 +1,26 @@
services:
caddy:
image: ${SEAFILE_CADDY_IMAGE:-lucaslorentz/caddy-docker-proxy:2.9}
restart: unless-stopped
container_name: seafile-caddy
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=seafile-net
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${SEAFILE_CADDY_VOLUMES:-/opt/seafile-caddy}:/data/caddy
networks:
- seafile-net
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:2019/metrics || exit 1"]
start_period: 20s
interval: 20s
timeout: 5s
retries: 3
networks:
seafile-net:
name: seafile-net

View File

@ -21,20 +21,26 @@ services:
seafile:
image: ${SEAFILE_IMAGE:-seafileltd/seafile-mc:12.0-latest}
container_name: seafile
ports:
- "80:80"
- ${SEAFILE_SSL_PORT:-}:443
# ports:
# - "80:80"
volumes:
- ${SEAFILE_VOLUMES:-/opt/seafile-data}:/shared
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_ROOT_PASSWD=${SEAFILE_MYSQL_ROOT_PASSWORD:?Variable is not set or empty}
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- SEAFILE_ADMIN_EMAIL=${SEAFILE_ADMIN_EMAIL:-me@example.com}
- SEAFILE_ADMIN_PASSWORD=${SEAFILE_ADMIN_PASSWORD:-asecret}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:-example.seafile.com}
- SEAFILE_SERVER_LETSENCRYPT=${SEAFILE_SERVER_LETSENCRYPT:-false}
- FORCE_HTTPS_IN_CONF=${SEAFILE_FORCE_HTTPS_IN_CONF:-false}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
- SEAFILE_SERVER_PROTOCOL=${SEAFILE_SERVER_PROTOCOL:-http}
- SITE_ROOT=${SITE_ROOT:-/}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- ENABLE_SEADOC=${ENABLE_SEADOC:-false}
- SEADOC_SERVER_URL=${SEADOC_SERVER_URL:-http://example.example.com/sdoc-server}
labels:
caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.reverse_proxy: "{{upstreams 80}}"
depends_on:
- db
- memcached
@ -43,3 +49,4 @@ services:
networks:
seafile-net:
name: seafile-net

View File

@ -1,22 +1,34 @@
COMPOSE_FILE='docker-compose.yml'
COMPOSE_FILE='docker-compose.yml,caddy.yml'
COMPOSE_PATH_SEPARATOR=','
SEAFILE_IMAGE=seafileltd/seafile-mc:12.0-latest
SEAFILE_DB_IMAGE=mariadb:10.11
SEAFILE_MEMCACHED_IMAGE=memcached:1.6.29
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9
SEAFILE_VOLUMES=/opt/seafile-data
SEAFILE_MYSQL_VOLUMES=/opt/seafile-mysql/db
SEAFILE_CADDY_VOLUMES=/opt/seafile-caddy
SEAFILE_MYSQL_DB_HOST=db
SEAFILE_MYSQL_ROOT_PASSWORD=PASSWORD
SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD
TIME_ZONE=Etc/UTC
JWT_PRIVATE_KEY=
SEAFILE_SERVER_HOSTNAME=example.seafile.com
SEAFILE_SERVER_LETSENCRYPT=false
SEAFILE_FORCE_HTTPS_IN_CONF=false
SEAFILE_SSL_PORT=
SEAFILE_SERVER_PROTOCOL=http
SEAFILE_ADMIN_EMAIL=me@example.com
SEAFILE_ADMIN_PASSWORD=asecret
SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEADOC_VOLUMES=/opt/seadoc-data
ENABLE_SEADOC=false
SEADOC_SERVER_URL=http://example.seafile.com/sdoc-server

View File

@ -0,0 +1,34 @@
services:
seadoc:
image: ${SEADOC_IMAGE:-seafileltd/sdoc-server:1.0-latest}
container_name: seadoc
volumes:
- ${SEADOC_VOLUMES:-/opt/seadoc-data/}:/shared
# ports:
# - "80:80"
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- DB_NAME=${SEADOC_MYSQL_DB_NAME:-seahub_db}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- SEAHUB_SERVICE_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
labels:
caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.@ws.0_header: "Connection *Upgrade*"
caddy.@ws.1_header: "Upgrade websocket"
caddy.0_reverse_proxy: "@ws {{upstreams 80}}"
caddy.1_handle_path: "/socket.io/*"
caddy.1_handle_path.0_rewrite: "* /socket.io{uri}"
caddy.1_handle_path.1_reverse_proxy: "{{upstreams 80}}"
caddy.2_handle_path: "/sdoc-server/*"
caddy.2_handle_path.0_rewrite: "* {uri}"
networks:
- seafile-net
networks:
seafile-net:
name: seafile-net

View File

@ -0,0 +1,26 @@
services:
caddy:
image: ${SEAFILE_CADDY_IMAGE:-lucaslorentz/caddy-docker-proxy:2.9}
restart: unless-stopped
container_name: seafile-caddy
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=seafile-net
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ${SEAFILE_CADDY_VOLUMES:-/opt/seafile-caddy}:/data/caddy
networks:
- seafile-net
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:2019/metrics || exit 1"]
start_period: 20s
interval: 20s
timeout: 5s
retries: 3
networks:
seafile-net:
name: seafile-net

View File

@ -39,20 +39,26 @@ services:
seafile:
image: ${SEAFILE_IMAGE:-docker.seadrive.org/seafileltd/seafile-pro-mc:12.0-latest}
container_name: seafile
ports:
- 80:80
- ${SEAFILE_SSL_PORT:-}:443
# ports:
# - "80:80"
volumes:
- ${SEAFILE_VOLUMES:-/opt/seafile-data}:/shared
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_ROOT_PASSWD=${SEAFILE_MYSQL_ROOT_PASSWORD:?Variable is not set or empty}
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- SEAFILE_ADMIN_EMAIL=${SEAFILE_ADMIN_EMAIL:-me@example.com}
- SEAFILE_ADMIN_PASSWORD=${SEAFILE_ADMIN_PASSWORD:-asecret}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:-example.seafile.com}
- SEAFILE_SERVER_LETSENCRYPT=${SEAFILE_SERVER_LETSENCRYPT:-false}
- FORCE_HTTPS_IN_CONF=${SEAFILE_FORCE_HTTPS_IN_CONF:-false}
- SEAFILE_SERVER_HOSTNAME=${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
- SEAFILE_SERVER_PROTOCOL=${SEAFILE_SERVER_PROTOCOL:-http}
- SITE_ROOT=${SITE_ROOT:-/}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- ENABLE_SEADOC=${ENABLE_SEADOC:-false}
- SEADOC_SERVER_URL=${SEADOC_SERVER_URL:-http://example.example.com/sdoc-server}
labels:
caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.reverse_proxy: "{{upstreams 80}}"
depends_on:
- db
- memcached
@ -62,3 +68,4 @@ services:
networks:
seafile-net:
name: seafile-net

View File

@ -1,4 +1,4 @@
COMPOSE_FILE='docker-compose.yml'
COMPOSE_FILE='docker-compose.yml,caddy.yml'
COMPOSE_PATH_SEPARATOR=','
@ -6,19 +6,31 @@ SEAFILE_IMAGE=docker.seadrive.org/seafileltd/seafile-pro-mc:12.0-latest
SEAFILE_DB_IMAGE=mariadb:10.11
SEAFILE_MEMCACHED_IMAGE=memcached:1.6.29
SEAFILE_ELASTICSEARCH_IMAGE=elasticsearch:8.15.0
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9
SEAFILE_VOLUMES=/opt/seafile-data
SEAFILE_MYSQL_VOLUMES=/opt/seafile-mysql/db
SEAFILE_ELASTICSEARCH_VOLUMES=/opt/seafile-elasticsearch/data
SEAFILE_CADDY_VOLUMES=/opt/seafile-caddy
SEAFILE_MYSQL_DB_HOST=db
SEAFILE_MYSQL_ROOT_PASSWORD=PASSWORD
SEAFILE_MYSQL_ROOT_PASSWORD=ROOT_PASSWORD
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD
TIME_ZONE=Etc/UTC
JWT_PRIVATE_KEY=
SEAFILE_SERVER_HOSTNAME=example.seafile.com
SEAFILE_SERVER_LETSENCRYPT=false
SEAFILE_FORCE_HTTPS_IN_CONF=false
SEAFILE_SSL_PORT=
SEAFILE_SERVER_PROTOCOL=http
SEAFILE_ADMIN_EMAIL=me@example.com
SEAFILE_ADMIN_PASSWORD=asecret
SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEADOC_VOLUMES=/opt/seadoc-data
ENABLE_SEADOC=false
SEADOC_SERVER_URL=http://example.seafile.com/sdoc-server

View File

@ -0,0 +1,34 @@
services:
seadoc:
image: ${SEADOC_IMAGE:-seafileltd/sdoc-server:1.0-latest}
container_name: seadoc
volumes:
- ${SEADOC_VOLUMES:-/opt/seadoc-data/}:/shared
# ports:
# - "80:80"
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- DB_NAME=${SEADOC_MYSQL_DB_NAME:-seahub_db}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- SEAHUB_SERVICE_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
labels:
caddy: ${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
caddy.@ws.0_header: "Connection *Upgrade*"
caddy.@ws.1_header: "Upgrade websocket"
caddy.0_reverse_proxy: "@ws {{upstreams 80}}"
caddy.1_handle_path: "/socket.io/*"
caddy.1_handle_path.0_rewrite: "* /socket.io{uri}"
caddy.1_handle_path.1_reverse_proxy: "{{upstreams 80}}"
caddy.2_handle_path: "/sdoc-server/*"
caddy.2_handle_path.0_rewrite: "* {uri}"
networks:
- seafile-net
networks:
seafile-net:
name: seafile-net

View File

@ -1,22 +0,0 @@
services:
sdoc-server:
image: ${SEADOC_IMAGE:-seafileltd/sdoc-server:latest}
container_name: sdoc-server
volumes:
- ${SEADOC_VOLUMES:-/opt/seadoc-data/}:/shared
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- DB_PASSWD=${SEAFILE_MYSQL_DB_PASSWD:?Variable is not set or empty}
- DB_NAME=${SEADOC_MYSQL_DB_NAME:-seahub_db}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- SEADOC_SERVER_LETSENCRYPT=${SEADOC_SERVER_LETSENCRYPT:-false}
- SEADOC_SERVER_HOSTNAME=${SEADOC_SERVER_HOSTNAME:-sdoc-server.example.com}
- SEAHUB_SERVICE_URL=${SEAHUB_SERVICE_URL:-http://seafile.example.com}
networks:
- seafile-net
networks:
seafile-net:

View File

@ -1,23 +1,31 @@
services:
sdoc-server:
image: ${SEADOC_IMAGE:-seafileltd/sdoc-server:latest}
container_name: sdoc-server
ports:
- 80:80
- ${SEADOC_SSL_PORT:-}:443
seadoc:
image: ${SEADOC_IMAGE:-seafileltd/sdoc-server:1.0-latest}
container_name: seadoc
volumes:
- ${SEADOC_VOLUMES:-/opt/seadoc-data/}:/shared
# ports:
# - "80:80"
environment:
- DB_HOST=${SEAFILE_MYSQL_DB_HOST:-db}
- DB_PORT=${SEAFILE_MYSQL_DB_PORT:-3306}
- DB_USER=${SEAFILE_MYSQL_DB_USER:-seafile}
- DB_PASSWD=${SEAFILE_MYSQL_DB_PASSWD:?Variable is not set or empty}
- DB_PASSWORD=${SEAFILE_MYSQL_DB_PASSWORD:?Variable is not set or empty}
- DB_NAME=${SEADOC_MYSQL_DB_NAME:-seahub_db}
- TIME_ZONE=${TIME_ZONE:-Etc/UTC}
- SEADOC_SERVER_LETSENCRYPT=${SEADOC_SERVER_LETSENCRYPT:-false}
- SEADOC_SERVER_HOSTNAME=${SEADOC_SERVER_HOSTNAME:-sdoc-server.example.com}
- SEAHUB_SERVICE_URL=${SEAHUB_SERVICE_URL:-http://seafile.example.com}
- JWT_PRIVATE_KEY=${JWT_PRIVATE_KEY:?Variable is not set or empty}
- SEAHUB_SERVICE_URL=${SEAFILE_SERVER_PROTOCOL:-http}://${SEAFILE_SERVER_HOSTNAME:?Variable is not set or empty}
labels:
caddy: ${SEADOC_SERVER_URL:?Variable is not set or empty}
caddy.@ws.0_header: "Connection *Upgrade*"
caddy.@ws.1_header: "Upgrade websocket"
caddy.0_reverse_proxy: "@ws {{upstreams 80}}"
caddy.1_handle_path: "/socket.io/*"
caddy.1_handle_path.0_rewrite: "* /socket.io{uri}"
caddy.1_handle_path.1_reverse_proxy: "{{upstreams 80}}"
caddy.2_handle_path: "/sdoc-server/*"
caddy.2_handle_path.0_rewrite: "* {uri}"
networks:
- seafile-net

View File

@ -2,17 +2,21 @@ COMPOSE_FILE='docker-compose.yml'
COMPOSE_PATH_SEPARATOR=','
SEADOC_IMAGE=seafileltd/sdoc-server:latest
SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEAFILE_CADDY_IMAGE=lucaslorentz/caddy-docker-proxy:2.9
SEADOC_VOLUMES=/opt/seadoc-data
SEAFILE_CADDY_VOLUMES=/opt/seafile-caddy
SEAFILE_MYSQL_DB_HOST=192.168.0.2
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWD=PASSWORD
SEAFILE_MYSQL_DB_PASSWORD=PASSWORD
TIME_ZONE=Etc/UTC
SEAHUB_SERVICE_URL=http://seafile.example.com
JWT_PRIVATE_KEY=
SEADOC_SERVER_HOSTNAME=sdoc-server.example.com
SEADOC_SERVER_LETSENCRYPT=false
SEADOC_SSL_PORT=
SEAFILE_SERVER_HOSTNAME=example.seafile.com
SEAFILE_SERVER_PROTOCOL=http
SEADOC_SERVER_URL=http://example.seadoc.com

View File

@ -99,94 +99,103 @@ First, backup the original docker-compose.yml file:
mv docker-compose.yml docker-compose.yml.bak
```
Then download [.env](https://manual.seafile.com/docker/docker-compose/ce/12.0/env) and [docker-compose.yml](https://manual.seafile.com/docker/docker-compose/ce/12.0/docker-compose.yml), and modify .env file according to the old configuration in `docker-compose.yml.bak`
Then download [.env](https://manual.seafile.com/docker/docker-compose/ce/12.0/env), [docker-compose.yml](https://manual.seafile.com/docker/docker-compose/ce/12.0/docker-compose.yml) and [caddy.yml](https://manual.seafile.com/docker/docker-compose/ce/12.0/caddy.yml), and modify .env file according to the old configuration in `docker-compose.yml.bak`
```sh
wegt -O .env https://manual.seafile.com/docker/docker-compose/ce/12.0/env
wget https://manual.seafile.com/docker/docker-compose/ce/12.0/docker-compose.yml
wget https://manual.seafile.com/docker/docker-compose/ce/12.0/caddy.yml
```
The following fields merit particular attention:
* The password of MySQL root (SEAFILE_MYSQL_ROOT_PASSWORD)
* The volume directory of MySQL data (SEAFILE_MYSQL_VOLUMES)
* The volume directory of Seafile data (SEAFILE_VOLUMES).
* The volume directory of Seafile data (SEAFILE_VOLUMES, same as the seafile volumes in the old docker-compose.yml)
* The volume directory of MySQL data (SEAFILE_MYSQL_VOLUMES, same as the mysql volumes in the old docker-compose.yml)
* The volume directory of Caddy data (SEAFILE_CADDY_VOLUMES)
* The user of MySQL (SEAFILE_MYSQL_DB_USER, `database` - `user` can be found in conf/seafile.conf)
* The password of MySQL (SEAFILE_MYSQL_DB_PASSWORD, `database` - `password` can be found in seafile.conf)
* jwt (JWT_PRIVATE_KEY, A random string with a length of no less than 32 characters)
* SEAFILE_SERVER_HOSTNAME (SEAFILE_SERVER_HOSTNAME, same as the SEAFILE_SERVER_HOSTNAME in the old docker-compose.yml)
* SEAFILE_SERVER_PROTOCOL (SEAFILE_SERVER_PROTOCOL, use http or https)
If you have used SSL before, you will also need modify the seafile.nginx.conf. Change server listen 443 to 80.
Backup the original seafile.nginx.conf file:
```sh
cp seafile.nginx.conf seafile.nginx.conf.bak
```
Remove the `server listen 80` section:
```config
#server {
# listen 80;
# server_name _ default_server;
# allow certbot to connect to challenge location via HTTP Port 80
# otherwise renewal request will fail
# location /.well-known/acme-challenge/ {
# alias /var/www/challenges/;
# try_files $uri =404;
# }
# location / {
# rewrite ^ https://example.seafile.com$request_uri? permanent;
# }
#}
```
Change `server listen 443` to `80`:
```config
server {
#listen 443 ssl;
listen 80;
# ssl_certificate /shared/ssl/pkg.seafile.top.crt;
# ssl_certificate_key /shared/ssl/pkg.seafile.top.key;
# ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;
...
```
Start with docker compose up.
### Upgrade SeaDoc from 0.8 to 1.0 for Seafile v12.0
If you have deployed SeaDoc extension in version 11.0, please use the following steps to upgrade it to version 1.0.
SeaDoc 1.0 is for working with Seafile 12.0.
SeaDoc 1.0 is for working with Seafile 12.0. SeaDoc and Seafile are deployed in the same directory.
#### Change the DB_NAME
In version 1.0, we use .env file to configure SeaDoc docker image, instead of modifying the docker-compose.yml file directly.
From version 1.0, SeaDoc is using seahub_db database to store its operation logs and no longer need an extra database sdoc_db. You need to change the `DB_NAME` to `seahub_db` in the config file manually.
conf/sdoc_server_config.json
```json
"database": "seahub_db"
```
#### Update the docker compose file
In version 1.0, we use env file to configure SeaDoc docker image, instead of modifying the docker-compose.yml file directly.
Use one of the following method to upgrade the docker compose file depends on your current deployment method.
##### For deployment where SeaDoc is on a separate host
Make sure you have installed Seafile 12.0, then backup old SeaDoc docker-compose.yml file.
Download [seadoc.yml](https://manual.seafile.com/docker/docker-compose/ce/12.0/seadoc.yml) to the Seafile `docker-compose.yml` directory, then modify Seafile .env file.
```sh
mv docker-compose.yml docker-compose.yml.bak
wegt https://manual.seafile.com/docker/docker-compose/ce/12.0/seadoc.yml
```
Download [.env](https://manual.seafile.com/docker/docker-compose/seadoc/1.0/standalone/env) and [docker-compose.yml](https://manual.seafile.com/docker/docker-compose/seadoc/1.0/standalone/docker-compose.yml), then modify .env file.
The following fields merit particular attention:
* Seafile MySQL host (SEAFILE_MYSQL_DB_HOST)
* Seafile MySQL user (SEAFILE_MYSQL_DB_USER)
* Seafile MySQL password (SEAFILE_MYSQL_DB_PASSWD)
* The volume directory of SeaDoc data (SEADOC_VOLUMES)
* SeaDoc service URL (SDOC_SERVER_HOSTNAME)
* Seafile service URL (SEAHUB_SERVICE_URL)
Start SeaDoc server with the following command
```sh
docker compose up -d
```
##### For deployment where SeaDoc and Seafile docker are on the same host
Make sure you have installed Seafile Docker 12.0.
Download [seadoc.yml](https://manual.seafile.com/docker/docker-compose/seadoc/1.0/seadoc.yml) to the Seafile path, then modify Seafile .env file.
Note: modify the `COMPOSE_FILE` field, and add all other fields.
```env
COMPOSE_FILE='docker-compose.yml,seadoc.yml'
COMPOSE_FILE='docker-compose.yml,caddy.yml,seadoc.yml'
SEADOC_IMAGE=seafileltd/sdoc-server:1.0-latest
SEADOC_VOLUMES=/opt/seadoc-data
SEAFILE_MYSQL_DB_USER=seafile
SEAFILE_MYSQL_DB_PASSWD=PASSWORD
SEAHUB_SERVICE_URL=http://seafile.example.com
ENABLE_SEADOC=true
SEADOC_SERVER_URL=http://example.seafile.com/sdoc-server
```
The following fields merit particular attention:
* Seafile MySQL user (SEAFILE_MYSQL_DB_USER)
* Seafile MySQL password (SEAFILE_MYSQL_DB_PASSWD)
* Add `seadoc.yml` to the `COMPOSE_FILE` field.
* The volume directory of SeaDoc data (SEADOC_VOLUMES)
* Seafile service URL (SEAHUB_SERVICE_URL)
* Enable SeaDoc (ENABLE_SEADOC)
* SeaDoc service url (SEADOC_SERVER_URL, hostname + `/sdoc-server`)
Start Seafile server and SeaDoc server with the following command
```sh
docker compose down
docker compose up -d
```
```