Code in this video_Docker – Install GLPI Server with Docker

📌 Replace the highlighted information with your own

version: '3.7'

services:
db:
image: mariadb:10.5 # Stable version of MariaDB
container_name: glpi_db
restart: unless-stopped # Auto-restart if the container stops
environment:
MYSQL_DATABASE: glpi_db # Database name
MYSQL_USER: glpi_db_user # Database user
MYSQL_PASSWORD: glpi_db_PWD # User's password
MYSQL_ROOT_PASSWORD: rootpass # Root password
volumes:
- ./storage/mysql:/var/lib/mysql # Store DB data on host for backup
networks:
- glpi_net

glpi:
image: glpi/glpi:latest # Official GLPI Docker image
container_name: glpi_web
restart: unless-stopped
depends_on:
- db # Wait for DB to be ready first
ports:
- "8081:80" # Access GLPI via localhost:8081
environment:
TIMEZONE: Asia/Ho_Chi_Minh # Set correct timezone (change as needed)
volumes:
- ./storage/glpi:/var/glpi # Store GLPI files on the host
networks:
- glpi_net

networks:
glpi_net: # Internal Docker network

Leave a Reply

Your email address will not be published. Required fields are marked *