├── .gitignore ├── LICENSE ├── README.md └── docker-compose.yml /.gitignore: -------------------------------------------------------------------------------- 1 | .env -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 David Alecrim 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Snipe-it Docker Compose Setup 2 | 3 | This repo has all the necessary configurations in order to run a snipe-it asset manager instance by simply running one command: 4 | 5 | ``` 6 | docker-compose up 7 | ``` 8 | 9 | Of course for this you need to have the Docker Engine installed on the desired deploy destination machine. 10 | 11 | In order to work, you will have to create a **.env** file in the root folder with the following info: 12 | 13 | ```bash 14 | # Mysql Parameters 15 | MYSQL_PORT_3306_TCP_ADDR=snipe-mysql 16 | MYSQL_PORT_3306_TCP_PORT=3306 17 | MYSQL_ROOT_PASSWORD=YOUR_ROOT_PW 18 | MYSQL_DATABASE=snipeit 19 | MYSQL_USER=snipeit 20 | MYSQL_PASSWORD=snipeit 21 | 22 | # Email Parameters 23 | # - the hostname/IP address of your mailserver 24 | MAIL_PORT_587_TCP_ADDR=smtp.example.com 25 | #the port for the mailserver (probably 587, could be another) 26 | MAIL_PORT_587_TCP_PORT=587 27 | # the default from address, and from name for emails 28 | MAIL_ENV_FROM_ADDR=ex@email.com 29 | MAIL_ENV_FROM_NAME=Your Name 30 | # - pick 'tls' for SMTP-over-SSL, 'tcp' for unencrypted 31 | MAIL_ENV_ENCRYPTION=tls 32 | # SMTP username and password 33 | MAIL_ENV_USERNAME=your_username 34 | MAIL_ENV_PASSWORD=your_email_pw 35 | 36 | # Snipe-IT Settings 37 | APP_ENV=production 38 | APP_DEBUG=false 39 | APP_KEY={{INSERT_API_TOKEN}} 40 | APP_URL=http://127.0.0.1:80 41 | APP_TIMEZONE=Europe/London # you should change this to your timezone 42 | APP_LOCALE=en # you should change this for the desired language 43 | ``` 44 | 45 | # API Key 46 | 47 | 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. 48 | 49 | You can do this with: 50 | 51 | ``` 52 | docker exec -it your-snipe-it-container-name sh 53 | ``` 54 | 55 | 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: 56 | 57 | ``` 58 | php artisan key:generate --show 59 | ``` 60 | 61 | As the output you will have something like: 62 | 63 | `base64:ahsfhjghjSHJFGHJASGFjhGSFJHgashjfgha=` 64 | 65 | Now go to your **.env** file and replace: 66 | 67 | `{{INSERT_API_TOKEN}}` 68 | 69 | with: 70 | 71 | `base64:ahsfhjghjSHJFGHJASGFjhGSFJHgashjfgha=` 72 | 73 | And now if you restart your containers with for instance: 74 | 75 | ``` 76 | docker-compose down && docker-compose up -d --build 77 | ``` 78 | 79 | You should be good and have everything available at: 80 | 81 | `http://localhost:3051` 82 | 83 | Happy asset managing!!! 84 | 85 | # License 86 | 87 | [MIT](./LICENSE) -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | 5 | snipe-mysql: 6 | container_name: snipe-mysql 7 | image: mysql:5.6 8 | env_file: 9 | - ./.env 10 | volumes: 11 | - snipesql-vol:/var/lib/mysql 12 | command: --default-authentication-plugin=mysql_native_password 13 | expose: 14 | - "3306" 15 | 16 | snipe-it: 17 | image: snipe/snipe-it 18 | env_file: 19 | - ./.env 20 | ports: 21 | - "3051:80" 22 | depends_on: 23 | - snipe-mysql 24 | 25 | volumes: 26 | snipesql-vol: --------------------------------------------------------------------------------