Snipe-it Docker Compose Setup This repo has all the necessary configurations in order to run a snipe-it asset manager instance by simply running one command:
docker-compose up Of course for this you need to have the Docker Engine installed on the desired deploy destination machine.
In order to work, you will have to create a .env file in the root folder with the following info:
MYSQL_PORT_3306_TCP_ADDR=snipe-db MYSQL_PORT_3306_TCP_PORT=3306 MYSQL_ROOT_PASSWORD=123456a@ MYSQL_DATABASE=snipeit MYSQL_USER=snipeit MYSQL_PASSWORD=snipeit
MAIL_PORT_587_TCP_ADDR=smtp.gmail.com MAIL_PORT_587_TCP_PORT=587 MAIL_ENV_USERNAME=your_username MAIL_ENV_PASSWORD=your_email_pw MAIL_ENV_ENCRYPTION=tls MAIL_ENV_FROM_ADDR=[email protected] MAIL_ENV_FROM_NAME=SnipeIT
MAIL_REPLYTO_ADDR=[email protected]
MAIL_BACKUP_NOTIFICATION_ADDRESS=[email protected]
APP_ENV=production APP_DEBUG=false APP_KEY={{INSERT_API_TOKEN}} APP_URL=http://127.0.0.1:80 APP_TIMEZONE=Asia/Ho_Chi_Minh APP_LOCALE=en # you should change this for the desired language #MAX_RESULTS=500
API Key Regarding the api key, the first time you launch the containers with the docker-compose up command, you will then need to attach to the snipe-it container.
You can do this with:
docker exec -it your-snipe-it-container-name sh You will then have shell access to the container and you need to run the following command on the root in order to get your API key:
php artisan key:generate --show As the output you will have something like:
base64:ahsfhjghjSHJFGHJASGFjhGSFJHgashjfgha=
Now go to your .env file and replace:
{{INSERT_API_TOKEN}}
with:
base64:ahsfhjghjSHJFGHJASGFjhGSFJHgashjfgha=
And now if you restart your containers with for instance:
docker-compose down && docker-compose up -d --build You should be good and have everything available at:
Happy asset managing!!!