Skip to content

Commit

Permalink
Update Docker getting started docs
Browse files Browse the repository at this point in the history
  • Loading branch information
admdly committed Dec 7, 2023
1 parent 441f5e0 commit acd007e
Showing 1 changed file with 53 additions and 38 deletions.
91 changes: 53 additions & 38 deletions pages/docs/getting-started/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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'

# <FontAwesomeIcon icon={faDocker} /> Install Using Docker

<Callout type="info" emoji={<FontAwesomeIcon icon={faPersonDigging} />}>
This guide is incomplete. Please help us complete it using the **"Edit this page"** button in the sidebar. Thanks!
</Callout>

## 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.
<Callout>
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.
</Callout>

<Tabs items={['Standalone', 'Docker Compose']}>
<Tab>

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.
</Tab>
<Tab>
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.
</Tab>
</Tabs>

### Post-installation steps
### Post-installation Steps

0 comments on commit acd007e

Please sign in to comment.