As a Roadiz website requires a database server and some SSH protocol to transfer
your local data, it will be more convenient to deploy using Docker Compose. It will
orchestrate each container with their volumes and link them together.

In a blank folder named site/ create a docker-compose.yml file
with the following content:

version:'3'services:MAIN:hostname:siteimage:roadiz/standard-edition# Only if you are using a proxy or/and backup container#network_mode: "bridge"ports:# For production only without a proxy-"80:80"volumes:-DATA:/datalinks:-DB:mariadbdepends_on:-DB# For production onlyrestart:alwayshealthcheck:test:["CMD","curl","-f","http://localhost"]interval:5m0stimeout:5sretries:3DB:image:ambroisemaupate/mariadbenvironment:MARIADB_USER:"username"MARIADB_PASS:"password"# Only if you are using a proxy or/and backup container#network_mode: "bridge"volumes:-DBDATA:/data# SSH container linked to db to# export or import mysqldumps and# sync your files from/to your local serverSSH:image:ambroisemaupate/light-ssh# Only if you are using a proxy or/and backup container#network_mode: "bridge"environment:PASS:"password"volumes:-DATA:/datalinks:-DB:mariadbdepends_on:-DBports:-"22/tcp"volumes:DATA:DBDATA:

Then launch your container network with docker-composeup-d. This will create:

site_MAIN_1 container

site_DB_1 container

site_SSH_1 container

site_DATA volume

site_DBDATA volume

After your container launch, you’ll find a blank /data/http folder in which you’ll have to clone your
Roadiz application. Then you’ll be able to import your database and your files (bin/roadizfiles:importyourZipFile.zip).

To configure your Roadiz website, edit your /data/http/app/conf/config.yml with nano editor.
If you get some “Unknown terminal error”, you have to edit your TERM environment variable: exportTERM=xterm.

doctrine:driver:pdo_mysql# Pay attention that DB host is not localhost but# mariadb as we defined an alias in our# docker-compose.yml file.host:mariadbuser:usernamepassword:password# DB name will automatically be named after usernamedbname:usernameport:nullunix_socket:nullpath:null

Roadiz docker image does not provide any mail transport agent. You’ll need to
subscribe to an external SMTP service if your website needs to send emails.
You can also link your Roadiz container with a dockerized Postfix service. In every cases
you’ll have to fill in mailer details in configuration.

We assume that you won’t do a fresh install of your website with Docker. So
you won’t need to access to the install.php entry point.

To copy your data from your local environment you will use your SSH container
to perform some scp and rsync commands between your computer and your
Docker container. Using a SSH container has the great advantage to start and stop
the server whenever you need it and to completely secure your data from outside.
Obviously, your Docker host SSH account must be securized too (public key only connection for root
or sudoonly connections).

For better security and SSL support with awesome and free Let’s Encrypt certificates,
you can use jwilder/nginx-proxy and
JrCs/docker-letsencrypt-nginx-proxy-companion Docker images.
Then you won’t need to publish your Roadiz ports anymore but to declare environment
variables called VIRTUAL_HOST, LETSENCRYPT_HOST and LETSENCRYPT_EMAIL to bind nginx front proxy to your container.

Note

As Docker Compose encapsulates every composed services in their own network, you have to
explicitely set network_mode:"bridge" mode. Without this setting, your front proxy
container won’t be able to reach your Roadiz container. This network mode is also required if you
need to run temporary containers linked to your database, for example a backup service.
If you are using Docker compose also for your Nging proxy setup, do not forget to add it
in its docker-compose.yml too.

You have to understand that using a front-proxy will obfuscate your visitors IP inside
your Roadiz container. You’ll have to trust the proxy request to get real remote IP and
protocol. (See Running Roadiz behind a reverse proxy)

version:'3'services:MAIN:hostname:siteimage:roadiz/standard-editionenvironment:# Only if you are using a proxy or/and backup container#network_mode: "bridge"ports:# For production only without a proxy-"80:80"volumes:-DATA:/datalinks:-DB:mariadb-SOLR:solrdepends_on:-DB-SOLR# For production onlyrestart:alwaysSOLR:image:solr# Only if you are using a proxy or/and backup container#network_mode: "bridge"entrypoint:-docker-entrypoint.sh-solr-precreate-sitevolumes:-SOLRDATA:/opt/solr/server/solr/mycores## …#volumes:DATA:DBDATA:SOLRDATA:

Then configure you Roadiz website to connect it to your Solr server (see Solr endpoint).
Do not forget to use solr hostname and site core name.