mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Merge pull request #15372 from StarlessNights/update-docker-compose-files
Fixed #15371: docker-compose files updated.
This commit is contained in:
commit
ec365b0804
|
@ -1,6 +1,8 @@
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
# REQUIRED: DB SETUP
|
# REQUIRED: DB SETUP
|
||||||
# --------------------------------------------
|
# --------------------------------------------
|
||||||
|
# https://mariadb.com/kb/en/mariadb-server-docker-official-image-environment-variables/
|
||||||
|
|
||||||
MYSQL_DATABASE=snipeit
|
MYSQL_DATABASE=snipeit
|
||||||
MYSQL_USER=snipeit
|
MYSQL_USER=snipeit
|
||||||
MYSQL_PASSWORD=changeme1234
|
MYSQL_PASSWORD=changeme1234
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# Compose file to spin up a local Snipe-IT for development.
|
||||||
|
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
@ -7,44 +9,40 @@ services:
|
||||||
dockerfile: Dockerfile.alpine
|
dockerfile: Dockerfile.alpine
|
||||||
container_name: snipeit
|
container_name: snipeit
|
||||||
ports:
|
ports:
|
||||||
- "8000:80"
|
- "8000:80"
|
||||||
volumes:
|
|
||||||
- ./storage/logs:/var/www/html/storage/logs
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- mariadb
|
redis:
|
||||||
- redis
|
# The default needs to be stated.
|
||||||
|
condition: service_started
|
||||||
|
mariadb:
|
||||||
|
condition: service_healthy
|
||||||
|
restart: true
|
||||||
env_file:
|
env_file:
|
||||||
- .env.docker
|
- .env.dev.docker
|
||||||
networks:
|
|
||||||
- snipeit-backend
|
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
image: mariadb:10.6.4-focal
|
image: mariadb:11.5.2
|
||||||
volumes:
|
volumes:
|
||||||
- db:/var/lib/mysql
|
- db:/var/lib/mysql
|
||||||
env_file:
|
env_file:
|
||||||
- .env.docker
|
- .env.dev.docker
|
||||||
networks:
|
|
||||||
- snipeit-backend
|
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
|
healthcheck:
|
||||||
|
# https://mariadb.com/kb/en/using-healthcheck-sh/#compose-file-example
|
||||||
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 2s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:6.2.5-buster
|
image: redis:7.4.0
|
||||||
networks:
|
|
||||||
- snipeit-backend
|
|
||||||
|
|
||||||
mailhog:
|
mailhog:
|
||||||
image: mailhog/mailhog:v1.0.1
|
image: mailhog/mailhog:v1.0.1
|
||||||
ports:
|
ports:
|
||||||
# - 1025:1025
|
# - 1025:1025
|
||||||
- "8025:8025"
|
- "8025:8025"
|
||||||
networks:
|
|
||||||
- snipeit-backend
|
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db: {}
|
db: {}
|
||||||
|
|
||||||
networks:
|
|
||||||
snipeit-backend: {}
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
|
# Compose file for production.
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db_data:
|
db_data:
|
||||||
storage:
|
storage:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: snipe/snipe-it:${APP_VERSION:-v6.4.1}
|
image: snipe/snipe-it:${APP_VERSION:-v7.0.11}
|
||||||
restart: always
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- storage:/var/lib/snipeit
|
- storage:/var/lib/snipeit
|
||||||
ports:
|
ports:
|
||||||
|
@ -18,8 +20,8 @@ services:
|
||||||
- .env
|
- .env
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: mariadb:10.6.4-focal
|
image: mariadb:11.5.2
|
||||||
restart: always
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- db_data:/var/lib/mysql
|
- db_data:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
|
@ -28,7 +30,8 @@ services:
|
||||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
|
# https://mariadb.com/kb/en/using-healthcheck-sh/#compose-file-example
|
||||||
|
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 1s
|
timeout: 1s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
Loading…
Reference in a new issue