L'application dockerisée se compose de 3 images :
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce docker-ce-cli containerd.io
Voir la documentation d'installation officielle ici
sudo apt-get install docker-compose-plugin
Voir la documentation d'installation officielle ici
Exécuter la commande :
mkdir mdf && cd mdf && touch docker-compose.yml
Ouvrir le fichier docker-compose.yml
et copier le contenu ci-dessous :
docker-compose.yml
version: '3.4'
services:
mdf-database:
image: postgres:13
restart: unless-stopped
networks:
- mdf-network
environment:
POSTGRES_DB: mdf
POSTGRES_USER: maarch
POSTGRES_PASSWORD: maarch
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U maarch" ]
interval: 10s
timeout: 5s
retries: 5
mdf-api:
image: labs.maarch.org:5050/maarch/mdf-api:latest
depends_on:
- mdf-database
restart: unless-stopped
networks:
- mdf-network
environment:
FIXTURE_SOURCE: dev
APP_ENV: prod
APP_SECRET: secret
DATABASE_URL: "postgresql://maarch:maarch@mdf-database:5432/mdf?serverVersion=13&charset=utf8"
MAILER_DSN: null://null
MAILER_SENDER: mdf@maarch.org
URL_HOST: http://{IP_SERVER}:3000
command: ./bin/ci/start_docker.sh
ports:
- 3000:80
mdf-front:
image: labs.maarch.org:5050/maarch/mdf-front:latest
restart: unless-stopped
networks:
- mdf-network
ports:
- 8080:80
environment:
API_URL: http://{IP_SERVER}:3000
FRONT_URL: http://{IP_SERVER}:8080
networks:
mdf-network:
driver: bridge
Remplacer {IP_SERVER} par l'IP de votre votre serveur
Depuis le dossier mdf
docker compose up -d
http://{IP_SERVER}:8080