You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+55-10Lines changed: 55 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -31,13 +31,16 @@ Dolibarr ERP & CRM is a modern software package to manage your organization's ac
31
31
32
32
## How to run this image ?
33
33
34
-
This image is based on the [official PHP repository](https://registry.hub.docker.com/_/php/).
34
+
This image is based on the [official PHP repository](https://registry.hub.docker.com/_/php/) and the [official Dolibarr repository](https://github.com/Dolibarr/dolibarr) but doesn't contains database. So you need to link it with a database container.
35
35
36
-
**Important**: This image don't contains database. So you need to link it with a database container.
36
+
Let's use [Docker Compose](https://docs.docker.com/compose/) to integrate it with [MariaDB](https://hub.docker.com/_/mariadb/) (you can also use [MySQL](https://hub.docker.com/_/mysql/) if you prefer):
37
37
38
-
Let's use [Docker Compose](https://docs.docker.com/compose/) to integrate it with [MariaDB](https://hub.docker.com/_/mariadb/) (you can also use [MySQL](https://hub.docker.com/_/mysql/) if you prefer).
38
+
If you want to have a persistent database and dolibarr data files after reboot or upgrade, you must first
39
+
create a directory /home/mariadb_data, /home/dolibarr_data and /home/dolibarr_custom on you host to store persistent files.
Remove the `install.lock` file and start an updated version container. Ensure that env `DOLI_INSTALL_AUTO` is set to `1`. It will migrate Database to the new version.
127
+
Then start an updated version container.
128
+
`sudo docker-compose pull`
129
+
`sudo docker-compose up -d`
130
+
`sudo docker-compose logs`
131
+
132
+
Ensure that env `DOLI_INSTALL_AUTO` is set to `1` so it will migrate Database to the new version.
91
133
You can still use the standard way to upgrade through web interface.
92
134
93
135
94
136
## Early support for PostgreSQL
137
+
95
138
Setting `DOLI_DB_TYPE` to `pgsql` enable Dolibarr to run with a PostgreSQL database.
96
139
When set to use `pgsql`, Dolibarr must be installed manually on it's first execution:
97
140
- Browse to `http://0.0.0.0/install`;
@@ -107,6 +150,8 @@ When setup this way, to upgrade version the use of the web interface is mandator
107
150
108
151
## Environment variables summary
109
152
153
+
You can use the following variables for a better customization of your docker-compose file.
This image is based on the [official PHP repository](https://registry.hub.docker.com/_/php/).
28
+
This image is based on the [official PHP repository](https://registry.hub.docker.com/_/php/) and the [official Dolibarr repository](https://github.com/Dolibarr/dolibarr) but doesn't contains database. So you need to link it with a database container.
29
+
30
+
Let's use [Docker Compose](https://docs.docker.com/compose/) to integrate it with [MariaDB](https://hub.docker.com/_/mariadb/) (you can also use [MySQL](https://hub.docker.com/_/mysql/) if you prefer):
25
31
26
-
**Important**: This image don't contains database. So you need to link it with a database container.
32
+
If you want to have a persistent database and dolibarr data files after reboot or upgrade, you must first
33
+
create a directory /home/mariadb_data, /home/dolibarr_data and /home/dolibarr_custom on you host to store persistent files.
27
34
28
-
Let's use [Docker Compose](https://docs.docker.com/compose/) to integrate it with [MariaDB](https://hub.docker.com/_/mariadb/) (you can also use [MySQL](https://hub.docker.com/_/mysql/) if you prefer).
Then, create a `docker-compose.yml` file as following:
31
38
32
39
```yaml
33
40
services:
@@ -36,37 +43,90 @@ services:
36
43
environment:
37
44
MYSQL_ROOT_PASSWORD: root
38
45
MYSQL_DATABASE: dolibarr
46
+
volumes:
47
+
- mariadb_data:/var/lib/mysql
39
48
40
49
web:
41
-
image: dolibarr/dolibarr
50
+
image: dolibarr/dolibarr:latest
42
51
environment:
43
52
DOLI_DB_HOST: mariadb
44
53
DOLI_DB_USER: root
45
54
DOLI_DB_PASSWORD: root
46
55
DOLI_DB_NAME: dolibarr
47
56
DOLI_URL_ROOT: 'http://0.0.0.0'
57
+
DOLI_ADMIN_LOGIN: 'admin'
58
+
DOLI_ADMIN_PASSWORD: 'admin'
48
59
PHP_INI_DATE_TIMEZONE: 'Europe/Paris'
49
60
ports:
50
61
- "80:80"
51
62
links:
52
63
- mariadb
64
+
volumes:
65
+
- dolibarr_data:/var/www/documents
66
+
- dolibarr_custom:/var/www/html/custom
67
+
68
+
volumes:
69
+
mariadb_data:
70
+
driver: local # Define the driver and options under the volume name
71
+
driver_opts:
72
+
type: none
73
+
device: /home/mariadb_data
74
+
o: bind
75
+
dolibarr_data:
76
+
driver: local # Define the driver and options under the volume name
77
+
driver_opts:
78
+
type: none
79
+
device: /home/dolibarr_data
80
+
o: bind
81
+
dolibarr_custom:
82
+
driver: local # Define the driver and options under the volume name
83
+
driver_opts:
84
+
type: none
85
+
device: /home/dolibarr_custom
86
+
o: bind
53
87
```
54
88
55
-
Then run all services `docker-compose up -d`. Now, go to http://0.0.0.0 to access to the new Dolibarr installation.
89
+
Then build and run all services (-d is to run in background)
90
+
`sudo docker-compose up -d`
91
+
92
+
You can check the web and the mariadb containers are up and see logs with
93
+
`sudo docker-compose ps`
94
+
`sudo docker-compose logs`
95
+
96
+
Once the log shows that the start is complete, go to http://0.0.0.0 to access to the new Dolibarr installation, first admin login is admin/admin.
97
+
98
+
Note: If the host port 80 is already used, you can replace "80:80" with "xx:80" where xx a free port on the host. You will be
99
+
able to access the Dolibarr using the URL http://0.0.0.0:xx
56
100
57
-
### Other examples
101
+
102
+
Other examples:
58
103
59
104
You can find several examples in the `examples` directory, such as:
60
105
- [Running Dolibarr with a mysql server](./examples/with-mysql/dolibarr-with-mysql.md)
61
106
- [Running Dolibarr with a Traefik reverse proxy](./examples/with-rp-traefik/dolibarr-with-traefik.md)
62
107
- [Running Dolibarr with secrets](./examples/with-secrets/dolibarr-with-secrets.md)
63
108
64
-
## Upgrading version and migrating DB
65
-
The `install.lock` file is located inside the container volume `/var/www/documents`.
66
109
67
-
Remove the `install.lock` file and start an updated version container. Ensure that env `DOLI_INSTALL_AUTO` is set to `1`. It will migrate Database to the new version.
110
+
## Upgrading Dolibarr version and migrating DB
111
+
112
+
Warning: Only data stored into persistent directories will not be lost after an upgrade of containers.
113
+
114
+
Remove the `install.lock` file. The `install.lock` file is located inside the container volume `/var/www/documents`.
0 commit comments