From acd007e9da8ce07c4c84314b1cbc4849311c4748 Mon Sep 17 00:00:00 2001 From: Adam Daley Date: Mon, 4 Dec 2023 17:51:29 +0000 Subject: [PATCH] Update Docker getting started docs --- pages/docs/getting-started/docker.mdx | 91 ++++++++++++++++----------- 1 file changed, 53 insertions(+), 38 deletions(-) diff --git a/pages/docs/getting-started/docker.mdx b/pages/docs/getting-started/docker.mdx index 90fc75d0..3ee87279 100644 --- a/pages/docs/getting-started/docker.mdx +++ b/pages/docs/getting-started/docker.mdx @@ -4,56 +4,71 @@ description: This guide will help you install FOSSBilling using our official Doc --- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faPersonDigging } from '@fortawesome/free-solid-svg-icons' import { faDocker } from '@fortawesome/free-brands-svg-icons' -import { Callout } from 'nextra-theme-docs' +import { Callout, Tabs, Tab } from 'nextra-theme-docs' # Install Using Docker -}> - This guide is incomplete. Please help us complete it using the **"Edit this page"** button in the sidebar. Thanks! - - ## But wait... What is Docker? Docker containers isolate the app from the host system and solve the "it works on my machine" headache. With this method, everyone using Docker runs virtually the same environment as the others. This is a great way to ensure that everyone has the same environment, thus making it less likely to have problems. Docker also lets you run multiple containers on the same machine with different configurations. To learn more about containers, we strongly advise you to read Docker's [explanation](https://www.docker.com/resources/what-container/) first. +## Prerequisites +Before going further, please make sure you have the Docker Engine installed. To install the Docker Engine, visit Docker's [installation page](https://docs.docker.com/engine/install/) and follow the instructions for your platform. + ## Instructions -Before going further, please make sure you have the Docker Engine and Docker Compose installed. To install the Docker Engine, visit Docker's [installation page](https://docs.docker.com/engine/install/). To install Docker Compose, visit Docker's [compose installation page](https://docs.docker.com/compose/install/). - -### Using the image with Docker Compose -This is an example of a docker-compose.yml file. You should change the values to suit your needs: - -```yaml -version: "3.9" -services: - fossbilling: - image: fossbilling/fossbilling - restart: always - ports: - - 80:80 - volumes: - - fossbilling:/var/www/html - mysql: - image: mysql:8.0 - restart: always - environment: - MYSQL_DATABASE: exampledb - MYSQL_USER: exampleuser - MYSQL_PASSWORD: examplepass - MYSQL_RANDOM_ROOT_PASSWORD: '1' - volumes: - - mysql:/var/lib/mysql +Our official Docker image can be used standalone or as part of a multi-container composition. The choice of which to use depends upon your needs and use-case. -volumes: - fossbilling: - mysql: -``` +As a general rule, if you are looking to run a simple FOSSBilling container that can connect to an external database, a standalone installation may be suitable. However, if you are looking for a complete ready-to-use environment, then using Docker Compose may be more appropriate. -Run `docker compose up` to start the containers. The first startup will take a while, this is because Docker will download the images. + + The instructions use the `latest` image, which is the latest stable version of FOSSBilling. This can be changed to `preview` for preview versions, or to a specific version number, if required. + + + + + + Then, use the web interface to install FOSSBilling. If you used this example, the database host field in the installer should be filled as `mysql`. Other fields should be self-explanatory. + + + This is an example `docker-compose.yml` which uses our image along with the MySQL image (adjust to suit your requirements): + + ```yaml + version: "3.9" + services: + fossbilling: + image: fossbilling/fossbilling:latest + restart: always + ports: + - 80:80 + volumes: + - fossbilling:/var/www/html + mysql: + image: mysql:8.2 + restart: always + environment: + MYSQL_DATABASE: fossbilling + MYSQL_USER: fossbilling + MYSQL_PASSWORD: fossbilling + MYSQL_RANDOM_ROOT_PASSWORD: '1' + volumes: + - mysql:/var/lib/mysql + volumes: + fossbilling: + mysql: + ``` -Then, use the web interface to install FOSSBilling. If you used this example, the database host field in the installer should be filled as `mysql`. Other fields should be self-explanatory. + While in the same directory as `docker-compose.yml` run `docker compose up` to start the containers. The first startup may take a while as Docker will download the required images. Once the containers have been started, the FOSSBilling web interface can be used to complete the install. + + If the above example has been used on a local machine, the FOSSBilling installer can be accessed at http://localhost. The required database details in this case are: + * Hostname: `mysql` + * Database: `fossbilling` + * Username: `fossbilling` + * Password: `fossbilling` + Otherwise, adapt the above based on your environment and requirements. + + -### Post-installation steps +### Post-installation Steps