41 lines
914 B
Plaintext
41 lines
914 B
Plaintext
nano docker-compose.yml
|
|
|
|
services:
|
|
glpi:
|
|
image: "glpi/glpi:latest"
|
|
restart: "unless-stopped"
|
|
volumes:
|
|
- "./storage/glpi:/var/glpi:rw"
|
|
env_file: .env # Pass environment variables from .env file to the container
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
ports:
|
|
- "80:80"
|
|
|
|
db:
|
|
image: "mysql"
|
|
restart: "unless-stopped"
|
|
volumes:
|
|
- "./storage/mysql:/var/lib/mysql"
|
|
environment:
|
|
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
|
|
MYSQL_DATABASE: ${GLPI_DB_NAME}
|
|
MYSQL_USER: ${GLPI_DB_USER}
|
|
MYSQL_PASSWORD: ${GLPI_DB_PASSWORD}
|
|
healthcheck:
|
|
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
|
|
start_period: 5s
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
expose:
|
|
- "3306"
|
|
|
|
nano .env
|
|
|
|
GLPI_DB_HOST=db
|
|
GLPI_DB_PORT=3306
|
|
GLPI_DB_NAME=glpi
|
|
GLPI_DB_USER=glpi
|
|
GLPI_DB_PASSWORD=glpi |