|
1 |
| -# OS2display docker server hosting |
| 1 | +# OS2display v2 Hosting and Deployment |
2 | 2 |
|
3 |
| -Basic docker based hosting setup for OS2display v.2 |
| 3 | +This is a deployment tool designed for hosting the OS2display v2 application using Docker. It provides a Docker-based setup, pre-configured files, and task automation to simplify the deployment and management of the application. |
4 | 4 |
|
5 |
| -## Deployment |
| 5 | +## Prerequisites |
6 | 6 |
|
7 |
| -### Containers |
| 7 | +Before you begin, ensure you have the following installed on your system: |
| 8 | +1. **Docker**: Install Docker Engine (version 20.10 or later). |
| 9 | +2. **Docker Compose**: Use Docker Compose v2 (integrated with the `docker compose` command). |
| 10 | +3. **Task**: Install the Taskfile CLI tool. You can find installation instructions [here](https://taskfile.dev/#/installation). |
8 | 11 |
|
9 |
| -Change the tags in .env.docker.local to the tags of the containers you wish to deploy. |
| 12 | +Make sure your user has the necessary permissions to run Docker commands (e.g., being part of the `docker` group). |
10 | 13 |
|
11 |
| -E.g. |
| 14 | +### Check Prerequisites |
12 | 15 |
|
13 |
| -```dotenv |
14 |
| -COMPOSE_VERSION_API=2.0.0 |
15 |
| -COMPOSE_VERSION_ADMIN=2.0.0 |
16 |
| -COMPOSE_VERSION_CLIENT=2.0.0 |
| 16 | +Run the following commands to verify that the prerequisites are installed: |
| 17 | + |
| 18 | +```bash |
| 19 | +# Check Docker installation |
| 20 | +docker --version |
| 21 | + |
| 22 | +# Check Docker Compose installation |
| 23 | +docker compose version |
| 24 | + |
| 25 | +# Check Taskfile CLI installation |
| 26 | +task --version |
17 | 27 | ```
|
| 28 | +## Secure Mode Requirement |
18 | 29 |
|
19 |
| -### Templates |
| 30 | +This project can only run in secure mode using HTTPS (port 443). To ensure proper functionality, you must provide a valid domain name and an SSL certificate. |
20 | 31 |
|
21 |
| -Import templates and screen layouts: |
| 32 | +### Steps to Configure Secure Mode: |
| 33 | +1. **Domain Name**: Use a fully qualified domain name (FQDN) that resolves to your server's IP address. |
| 34 | +2. **SSL Certificate**: Provide a valid SSL certificate and private key for the domain. |
| 35 | + - Place the certificate file (`docker.crt`) and the private key file (`docker.key`) in the `traefik/ssl` directory. |
| 36 | +3. **Update Configuration**: Ensure the domain name is correctly configured in the `.env.docker.local` file. |
22 | 37 |
|
23 |
| -#### Production |
| 38 | +Without a valid domain name and SSL certificate, the project will not function as expected. |
24 | 39 |
|
25 |
| -In production run the script `load-templates-prod.sh` with the TEMPLATES_RELEASE environment variable set to the tag of |
26 |
| -the templates to load. |
| 40 | +## Available Tasks |
27 | 41 |
|
28 |
| -E.g. |
| 42 | +The project uses a `Taskfile.yml` to simplify common operations. Below is a list of the most important tasks you can run: |
29 | 43 |
|
30 |
| -```shell |
31 |
| -TEMPLATES_RELEASE=2.1.0 ./load-templates-prod.sh |
32 |
| -``` |
| 44 | +### Installation and Setup |
| 45 | +- **`task install`**: Installs the project, pulls Docker images, sets up the database, and initializes the environment. |
| 46 | +- **`task reinstall`**: Reinstalls the project from scratch, removing all containers, volumes, and the database. |
| 47 | +- **`task up`**: Starts the environment without altering the existing state of the containers. |
| 48 | +- **`task down`**: Stops and removes all containers and volumes. |
33 | 49 |
|
34 |
| -#### Staging |
| 50 | +### Tenant and User Management |
| 51 | +- **`task tenant_add`**: Adds a new tenant group. A tenant is a group of users that share the same configuration. |
| 52 | +- **`task user_add`**: Adds a new user (editor or admin) to a tenant. |
35 | 53 |
|
36 |
| -In staging run the script `load-templates-develop.sh`. This will load the templates from the develop branch of the |
37 |
| -template repository. |
| 54 | +### Templates and Screen Layouts |
| 55 | +- **`task load_templates`**: Loads templates and screen layouts based on the configuration in `.env.docker.local`. |
38 | 56 |
|
| 57 | +### Maintenance |
| 58 | +- **`task logs`**: Follows the logs from the Docker containers. |
| 59 | +- **`task cc`**: Clears the cache in the application. |
| 60 | + |
| 61 | +### Pre-installation Notes |
| 62 | +Before running `task install`, ensure the following: |
| 63 | +1. Update `.env.docker.local` with your domain name (replace all 5 instances) and set secure passwords. |
| 64 | +2. Place your SSL certificate files (`docker.crt` and `docker.key`) in the `traefik/ssl` directory. |
| 65 | + |
| 66 | +For a full list of tasks, run: |
| 67 | +```bash |
| 68 | +task --list |
39 | 69 | ```
|
40 |
| -./load-templates-develop.sh |
41 |
| -``` |
| 70 | + |
| 71 | + |
| 72 | + |
0 commit comments