Jae’s News

Beep Boop

Home > Software > The answer to life, death and everything else

The answer to life, death and everything else

Wednesday 17 February 2021, by Jae

Isn’t that weird that everything ends up dying?
Why couldn’t be immortal?
What if we could just live indefinitely, forever...

Well, this article will not give you this answer but rather tell you how to install Spip on a server with Docker.
In this small tutorial, I’m assuming you are using Debian Buster as your server OS.

First step: install Docker

Installing Docker is pretty straightforward, and all the instructions are available on the official Docker website.
This can be summed up as (to execute as root):

apt remove docker docker-engine docker.io containerd runc

apt update

apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -

add-apt-repository \
  "deb [arch=amd64] https://download.docker.com/linux/debian \
  $(lsb_release -cs) \

apt update

apt install docker-ce docker-ce-cli containerd.io

systemctl start docker
systemctl enable docker

Also, do not forget to install docker-compose as these tools make easier the deployment of services:

curl -L "https://github.com/docker/compose/releases/download/1.28.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

And you’re all set-up for the rest!

Creating the Docker Compose file

Creating the docker-compose.yml is fairly easy:

version: '3'
   image: mariadb:10
   restart: always
     - MYSQL_DATABASE=spip
     - MYSQL_USER=spip
     - MYSQL_PASSWORD=verysecret
     - './spip-db:/var/lib/mysql'
    image: ashledombos/spip-web
      - php
      - db
      - './spip-core:/var/www/html/core'
      - './spip-data:/var/www/html/data'
    restart: always
      - SPIP_DB_SERVER=db
      - SPIP_DB_LOGIN=spip
      - SPIP_DB_PASS=verysecret
      - SPIP_DB_NAME=spip
      - '8031:80'
    image: 'ashledombos/spip-fpm:3.2'
      - db
      - './spip-core:/var/www/html/core'
      - './spip-data:/var/www/html/data'
      - SPIP_DB_SERVER=mysql
      - SPIP_DB_HOST=db
      - SPIP_DB_LOGIN=spip
      - SPIP_DB_PASS=verysecret
      - SPIP_DB_PREFIX=spip
      - SPIP_ADMIN_NAME=admin
      - SPIP_ADMIN_LOGIN=administrator
      - SPIP_ADMIN_EMAIL=me@domain.tld
      - SPIP_ADMIN_PASS=imverysecret
      - PHP_TIMEZONE=Europe/Paris

Of course, replace the passwords and ports with whatever fits you.
You can also use an environment file to store the passwords (which is recommended if you share your config in a public repo).

Now, all you have to do to start the services is docker-compose up -d.
All the basics of the docker-compose command can be seen on their official website.

Setting up the reverse proxy

As a reverse proxy, I am currently using the Caddy server as it is really easy to use and maintain.
It also has automatic SSL certificates (with auto-renew) which I find very practical.
In order to serve Spip to users, you need to add this to your Caddyfile:

https://domain.tld {
       encode zstd gzip

Note: the encode zstd gzip is only used to compress pages which can improve loading times in certain browsers.

And you should be all set-up, all is left to do is the regular Spip first startup configuration!