2024-08-22 05:47:12 -07:00
|
|
|
# Compose file for production.
|
|
|
|
|
2024-05-15 17:13:31 -07:00
|
|
|
volumes:
|
|
|
|
db_data:
|
|
|
|
storage:
|
|
|
|
|
|
|
|
services:
|
|
|
|
app:
|
2024-08-22 05:47:12 -07:00
|
|
|
image: snipe/snipe-it:${APP_VERSION:-v7.0.11}
|
|
|
|
restart: unless-stopped
|
2024-05-15 17:13:31 -07:00
|
|
|
volumes:
|
|
|
|
- storage:/var/lib/snipeit
|
|
|
|
ports:
|
|
|
|
- "${APP_PORT:-8000}:80"
|
|
|
|
depends_on:
|
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
env_file:
|
|
|
|
- .env
|
|
|
|
|
|
|
|
db:
|
2024-08-22 05:47:12 -07:00
|
|
|
image: mariadb:11.5.2
|
|
|
|
restart: unless-stopped
|
2024-05-15 17:13:31 -07:00
|
|
|
volumes:
|
|
|
|
- db_data:/var/lib/mysql
|
|
|
|
environment:
|
|
|
|
MYSQL_DATABASE: ${DB_DATABASE}
|
|
|
|
MYSQL_USER: ${DB_USERNAME}
|
|
|
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
|
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
|
|
healthcheck:
|
2024-08-22 05:47:12 -07:00
|
|
|
# https://mariadb.com/kb/en/using-healthcheck-sh/#compose-file-example
|
|
|
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
2024-05-15 17:13:31 -07:00
|
|
|
interval: 5s
|
|
|
|
timeout: 1s
|
|
|
|
retries: 5
|