diff --git a/README.md b/README.md index 7646da1..9c06cc3 100644 --- a/README.md +++ b/README.md @@ -83,65 +83,14 @@ For a small to medium installation, with a few hours of video uploaded daily, an In terms of disk space, think of what the needs will be. A general rule is to multiply by three the size of the expected uploaded videos (since the system keeps original versions, encoded versions plus HLS), so if you receive 1G of videos daily and maintain all of them, you should consider a 1T disk across a year (1G * 3 * 365). -## Installation +## Installation / Maintanance -There are two ways to run MediaCMS, through Docker Compose and through installing it on a server via an automation script that installs and configures all needed services. +There are two ways to run MediaCMS, through Docker Compose and through installing it on a server via an automation script that installs and configures all needed services. Find the related pages: -### Docker Compose installation -Install a recent version of [Docker](https://docs.docker.com/get-docker/), and [Docker Compose](https://docs.docker.com/compose/install/). +* [Single Server](docs/Single_Server.md) page +* [Docker Compose](docs/Docker_Compose.md) page -Run as root - -```bash -git clone https://github.com/mediacms-io/mediacms -cd mediacms -``` - -The default option is to serve MediaCMS on all ips available of the server (including localhost). - -Now run - -```bash -docker-compose up -``` - -This will download all MediaCMS related Docker images and start all containers. Once it finishes, MediaCMS will be installed and available on http://localhost or http://ip - -For more instructions, checkout the docs on the [Docker deployment](docs/Docker_deployment.md) page. - - -### Single server installation - -The core dependencies are Python3, Django3, Celery, PostgreSQL, Redis, ffmpeg. Any system that can have these dependencies installed, can run MediaCMS. But we strongly suggest installing on Linux Ubuntu 18 or 20 versions. - -Installation on a Ubuntu 18 or 20 system with git utility installed should be completed in a few minutes with the following steps. -Make sure you run it as user root, on a clear system, since the automatic script will install and configure the following services: Celery/PostgreSQL/Redis/Nginx and will override any existing settings. - -Automated script - tested on Ubuntu 18, Ubuntu 20, and Debian Buster - -```bash -mkdir /home/mediacms.io && cd /home/mediacms.io/ -git clone https://github.com/mediacms-io/mediacms -cd /home/mediacms.io/mediacms/ && bash ./install.sh -``` - -The script will ask if you have a URL where you want to deploy MediaCMS, otherwise it will use localhost. If you provide a URL, it will use Let's Encrypt service to install a valid ssl certificate. - - -## Update - -If you've used the above way to install MediaCMS, update with the following: - -```bash -cd /home/mediacms.io/mediacms # enter mediacms directory -source /home/mediacms.io/bin/activate # use virtualenv -git pull # update code -python manage.py migrate # run Django migrations -sudo systemctl restart mediacms celery_long celery_short # restart services -``` - - -## Configure +## Configuration Several options are available on cms/settings.py, most of the things that are allowed or should be disallowed are described there. It is advisable to override any of them by adding it to cms/local_settings.py. All configuration options will be documented gradually on the [Configuration](docs/Configuration.md) page. diff --git a/docs/Configuration.md b/docs/Configuration.md index f4bd22d..0078faa 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -8,12 +8,19 @@ In case of a the single server installation, add to `cms/local_settings.py` . In case of a docker compose installation, add to `deploy/docker/local_settings.py` . This will automatically overwrite `cms/local_settings.py` . -Any change needs restart of MediaCMS in order to take effect. So edit `cms/local_settings.py`, make a change and restart MediaCMS +Any change needs restart of MediaCMS in order to take effect. -``` +Single server installation: edit `cms/local_settings.py`, make a change and restart MediaCMS + +```bash #systemctl restart mediacms ``` +Docker Compose installation: edit `deploy/docker/local_settings.py`, make a change and restart MediaCMS containers + +```bash +#docker-compose restart web worker +``` ### change portal logo diff --git a/docs/Docker_Compose.md b/docs/Docker_Compose.md new file mode 100644 index 0000000..e61ba3a --- /dev/null +++ b/docs/Docker_Compose.md @@ -0,0 +1,41 @@ +# Docker Compose + +## Installation +Install a recent version of [Docker](https://docs.docker.com/get-docker/), and [Docker Compose](https://docs.docker.com/compose/install/). + +For Ubuntu 18/20 systems this is: + +```bash +curl -fsSL https://get.docker.com -o get-docker.sh +sudo sh get-docker.sh +sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +sudo chmod +x /usr/local/bin/docker-compose +``` + +Then run as root + +```bash +git clone https://github.com/mediacms-io/mediacms +cd mediacms +``` + +The default option is to serve MediaCMS on all ips available of the server (including localhost). +If you want to explore more options (including setup of https with letsencrypt certificate) checkout the docs on the [Docker deployment](/docs/Docker_deployment.md) page for different docker-compose setups to use. + +Run + +```bash +docker-compose up +``` + +This will download all MediaCMS related Docker images and start all containers. Once it finishes, MediaCMS will be installed and available on http://localhost or http://ip + + +## Configuration +Checkout the configuration docs on [Configuration](docs/Configuration.md) page. + + +## Maintenance +Database is stored on XX and media_files on YY + + diff --git a/docs/Docker_deployment.md b/docs/Docker_deployment.md index 13ba32c..e82f709 100644 --- a/docs/Docker_deployment.md +++ b/docs/Docker_deployment.md @@ -21,6 +21,10 @@ To run, update the configs above if necessary, build the image by running `docke The main container runs migrations, mediacms_web, celery_beat, celery_workers (celery_short and celery_long services), exposed on port 80 supported by redis and postgres database. The FRONTEND_HOST in `deploy/docker/local_settings.py` is configured as http://localhost, on the docker host machine. +## Server with ssl certificate through letencrypt service, https://host.com +In this case the FRONTEND_HOST should be set to https://host.com. Uses [this deployment](../docker-compose-letsencrypt.yaml). +Also you have to set a valid email on that file, on settings `LETSENCRYPT_EMAIL` + ## Advanced Deployment, accessed as http://localhost:8000 Here we can run 1 mediacms_web instance, with the FRONTEND_HOST in `deploy/docker/local_settings.py` configured as http://localhost:8000. This is bootstrapped by a single migrations instance and supported by a single celery_beat instance and 1 or more celery_worker instances. Redis and postgres containers are also used for persistence. Clients can access the service on http://localhost:8000, on the docker host machine. This is similar to [this deployment](../docker-compose.yaml), with a `port` defined in FRONTEND_HOST. diff --git a/docs/Single_Server.md b/docs/Single_Server.md new file mode 100644 index 0000000..3c81ac7 --- /dev/null +++ b/docs/Single_Server.md @@ -0,0 +1,38 @@ +# Single Server + +## Installation + +The core dependencies are Python3, Django3, Celery, PostgreSQL, Redis, ffmpeg. Any system that can have these dependencies installed, can run MediaCMS. But we strongly suggest installing on Linux Ubuntu 18 or 20 versions. + +Installation on a Ubuntu 18 or 20 system with git utility installed should be completed in a few minutes with the following steps. +Make sure you run it as user root, on a clear system, since the automatic script will install and configure the following services: Celery/PostgreSQL/Redis/Nginx and will override any existing settings. + +Automated script - tested on Ubuntu 18, Ubuntu 20, and Debian Buster + +```bash +mkdir /home/mediacms.io && cd /home/mediacms.io/ +git clone https://github.com/mediacms-io/mediacms +cd /home/mediacms.io/mediacms/ && bash ./install.sh +``` + +The script will ask if you have a URL where you want to deploy MediaCMS, otherwise it will use localhost. If you provide a URL, it will use Let's Encrypt service to install a valid ssl certificate. + + +## Update + +If you've used the above way to install MediaCMS, update with the following: + +```bash +cd /home/mediacms.io/mediacms # enter mediacms directory +source /home/mediacms.io/bin/activate # use virtualenv +git pull # update code +python manage.py migrate # run Django migrations +sudo systemctl restart mediacms celery_long celery_short # restart services +``` + +## Configuration +Checkout the configuration docs on [Configuration](docs/Configuration.md) page. + + +## Maintenance +Database can be backed up with pg_dump and media_files on Y/home/mediacms.io/mediacms/media_files \ No newline at end of file