1.安装好docker,和mysql数据库(创建新db snipe_it )。
2.docker pull snipe/snipe-it 直接安装最新版本。
3.获取APP_KEY 待填写入配置文件 :docker run --rm snipe/snipe-it ,base64开头的那串字符。
4.自定义文件snipe-it-env.env,放在/usr目录下即:/usr/snipe-it-env.env
5.编辑 snipe-it-env.env,修改 MYSQL_PORT_3306_TCP_ADDR,MYSQL_PORT_3306_TCP_PORT,MYSQL_USER,MYSQL_PASSWORD及APP_KEY(第3步获取的key)
# Mysql Parameters
MYSQL_PORT_3306_TCP_ADDR=mysql数据库ip
MYSQL_PORT_3306_TCP_PORT=3306
MYSQL_DATABASE=snipe_it
MYSQL_USER=root
MYSQL_PASSWORD=123456
# Email Parameters
# - the hostname/IP address of your mailserver
MAIL_PORT_587_TCP_ADDR=smtp.whatever.com
#the port for the mailserver (probably 587, could be another)
MAIL_PORT_587_TCP_PORT=587
# the default from address, and from name for emails
MAIL_ENV_FROM_ADDR=youremail@yourdomain.com
MAIL_ENV_FROM_NAME=Your Full Email Name
# - pick 'tls' for SMTP-over-SSL, 'tcp' for unencrypted
MAIL_ENV_ENCRYPTION=tcp
# SMTP username and password
MAIL_ENV_USERNAME=your_email_username
MAIL_ENV_PASSWORD=your_email_password
# Snipe-IT Settings
APP_ENV=production
APP_DEBUG=false
APP_KEY=需要生成
APP_URL=http://127.0.0.1:80
APP_TIMEZONE=US/Pacific
APP_LOCALE=zh-CN
6.创建目录 mkdir /var/lib/snipeit -p 7.创建docker容器 docker run -d -p 80:80 --name=“snipeit” --env-file=/usr/snipe-it-env.env --mount source=snipe-vol,dst=/var/lib/snipeit snipe/snipe-it
|