Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed Docker installation doc to MariaDB #812

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions docs/administration/docker/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,38 @@ In this article:

One of the ways to install EspoCRM is by using its official Docker Image. The EspoCRM Container Package contains the Docker image, which incorporates all the required files and dependencies to launch EspoCRM in development or production environments. You can use Docker to run EspoCRM in an isolated environment built with Docker containers.

EspoCRM image requires to run MySQL server:
EspoCRM image requires to run MariaDB server:

```
$ docker run --name mysql -e MYSQL_ROOT_PASSWORD=password -d mysql:8 --default-authentication-plugin=mysql_native_password
$ docker run --detach --name mariadb --env MARIADB_ROOT_PASSWORD=password mariadb:latest
```

- `mysql` — name of MySQL container,
- `MYSQL_ROOT_PASSWORD=password` — you can change `password` to any password you want,
- `mysql:8` — [MySQL image](https://hub.docker.com/_/mysql/tags) version.
- `mariadb` — name of MariaDB container,
- `MARIADB_ROOT_PASSWORD=password` — you can change `password` to any password you want,
- `mariadb:latest` — [MariaDB image](https://hub.docker.com/_/mariadb/tags) version.

Run EspoCRM container:

```
$ docker run --name my-espocrm --link mysql:mysql -d espocrm/espocrm
$ docker run --name my-espocrm --link mariadb:mariadb --env ESPOCRM_DATABASE_HOST=mariadb -d espocrm/espocrm
```

- `my-espocrm` — name of EspoCRM container,
- `mysql:mysql` — name (link) of MySQL container,
- `mariadb:mariadb` — name (link) of MariaDB container,
- `espocrm/espocrm` — [EspoCRM image](https://hub.docker.com/r/espocrm/espocrm/tags) version.

#### Run EspoCRM container via a specific port:

```
$ docker run --name my-espocrm -p 8080:80 --link mysql:mysql -d espocrm/espocrm
$ docker run --name my-espocrm -p 8080:80 --link mariadb:mariadb -d espocrm/espocrm
```

Then, access it via `http://localhost:8080` with credentials admin and password.

#### Run EspoCRM via a specific IP or a domain with a port:

```
$ docker run --name my-espocrm -e ESPOCRM_SITE_URL=http://172.20.0.100:8080 -p 8080:80 --link mysql:mysql -d espocrm/espocrm
$ docker run --name my-espocrm -e ESPOCRM_SITE_URL=http://172.20.0.100:8080 -p 8080:80 --link mariadb:mariadb -d espocrm/espocrm
```

Then, access it via `http://172.20.0.100:8080` with credentials **admin** and **password**.
Expand Down Expand Up @@ -72,24 +72,23 @@ version: '3.8'

services:

mysql:
image: mysql:8
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
espocrm-db:
image: mariadb:latest
container_name: espocrm-db
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: espocrm
MYSQL_USER: espocrm
MYSQL_PASSWORD: database_password
MARIADB_ROOT_PASSWORD: root_password
MARIADB_DATABASE: espocrm
MARIADB_USER: espocrm
MARIADB_PASSWORD: database_password
volumes:
- mysql:/var/lib/mysql
- espocrm-db:/var/lib/mysql
restart: always

espocrm:
image: espocrm/espocrm
container_name: espocrm
environment:
ESPOCRM_DATABASE_HOST: mysql
ESPOCRM_DATABASE_HOST: espocrm-db
ESPOCRM_DATABASE_USER: espocrm
ESPOCRM_DATABASE_PASSWORD: database_password
ESPOCRM_ADMIN_USERNAME: admin
Expand All @@ -98,6 +97,8 @@ services:
volumes:
- espocrm:/var/www/html
restart: always
depends_on:
- espocrm-db
ports:
- 8080:80

Expand All @@ -107,11 +108,13 @@ services:
volumes:
- espocrm:/var/www/html
restart: always
depends_on:
- espocrm
entrypoint: docker-daemon.sh

espocrm-websocket:
image: espocrm/espocrm
container_name: espocrm-websocket
container_name: espocrm-websocket
environment:
ESPOCRM_CONFIG_USE_WEB_SOCKET: "true"
ESPOCRM_CONFIG_WEB_SOCKET_URL: "ws://localhost:8081"
Expand All @@ -120,13 +123,15 @@ services:
volumes:
- espocrm:/var/www/html
restart: always
depends_on:
- espocrm
entrypoint: docker-websocket.sh
ports:
- 8081:8080

volumes:
mysql:
espocrm:
espocrm-db:
```

More about *Installation Enviroments* you can find [here](#installation-environments).
Expand Down Expand Up @@ -176,7 +181,7 @@ This is one-time environment variables which are using only for the fresh instal

- `ESPOCRM_DATABASE_HOST`

MySQL host name for EspoCRM. The default value is `mysql`.
Database host name for EspoCRM. The default value is `mysql`.

- `ESPOCRM_DATABASE_NAME`

Expand Down
43 changes: 24 additions & 19 deletions docs/administration/docker/traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,32 +37,33 @@ services:
- ./letsencrypt:/letsencrypt # volume for certificates (TLS)
- /var/run/docker.sock:/var/run/docker.sock:ro # volume for Docker admin

mysql:
image: mysql:latest
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
espocrm-db:
image: mariadb:latest
container_name: espocrm-db
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: espocrm
MYSQL_USER: espouser
MYSQL_PASSWORD: database_password
MARIADB_ROOT_PASSWORD: root_password
MARIADB_DATABASE: espocrm
MARIADB_USER: espocrm
MARIADB_PASSWORD: database_password
volumes:
- ./mysql:/var/lib/mysql
- espocrm-db:/var/lib/mysql
restart: always

espocrm:
image: espocrm/espocrm:latest
image: espocrm/espocrm
container_name: espocrm
environment:
ESPOCRM_DATABASE_HOST: mysql
ESPOCRM_DATABASE_USER: espouser
ESPOCRM_DATABASE_HOST: espocrm-db
ESPOCRM_DATABASE_USER: espocrm
ESPOCRM_DATABASE_PASSWORD: database_password
ESPOCRM_ADMIN_USERNAME: admin
ESPOCRM_ADMIN_PASSWORD: password
ESPOCRM_SITE_URL: "https://your_domain.com"
ESPOCRM_SITE_URL: "https://your_domain.com"
volumes:
- ./espocrm:/var/www/html
- espocrm:/var/www/html
restart: always
depends_on:
- espocrm-db
labels:
- traefik.enable=true
- traefik.http.routers.espocrm-app.rule=Host(`your_domain.com`)
Expand All @@ -71,24 +72,28 @@ services:
- traefik.http.routers.espocrm-app.tls.certresolver=esporesolver

espocrm-daemon:
image: espocrm/espocrm:latest
image: espocrm/espocrm
container_name: espocrm-daemon
volumes:
- ./espocrm:/var/www/html
- espocrm:/var/www/html
restart: always
depends_on:
- espocrm
entrypoint: docker-daemon.sh

espocrm-websocket:
image: espocrm/espocrm:latest
image: espocrm/espocrm
container_name: espocrm-websocket
environment:
ESPOCRM_CONFIG_USE_WEB_SOCKET: "true"
ESPOCRM_CONFIG_WEB_SOCKET_URL: "wss://your_domain.com/ws"
ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBSCRIBER_DSN: "tcp://*:7777"
ESPOCRM_CONFIG_WEB_SOCKET_ZERO_M_Q_SUBMISSION_DSN: "tcp://espocrm-websocket:7777"
volumes:
- ./espocrm:/var/www/html
- espocrm:/var/www/html
restart: always
depends_on:
- espocrm
entrypoint: docker-websocket.sh
labels:
- traefik.enable=true
Expand All @@ -98,8 +103,8 @@ services:
- traefik.http.routers.espocrm-ws.tls.certresolver=esporesolver

volumes:
mysql:
espocrm:
espocrm-db:
```

Let's take a closer look at the commands of the Traefik container:
Expand Down