Git Product home page Git Product logo

snipe-it-docker-compose's Introduction

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 Parameters
MYSQL_PORT_3306_TCP_ADDR=snipe-mysql
MYSQL_PORT_3306_TCP_PORT=3306
MYSQL_ROOT_PASSWORD=YOUR_ROOT_PW
MYSQL_DATABASE=snipeit
MYSQL_USER=snipeit
MYSQL_PASSWORD=snipeit

# Email Parameters
# - the hostname/IP address of your mailserver
MAIL_PORT_587_TCP_ADDR=smtp.example.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
[email protected]
MAIL_ENV_FROM_NAME=Your Name
# - pick 'tls' for SMTP-over-SSL, 'tcp' for unencrypted
MAIL_ENV_ENCRYPTION=tls
# SMTP username and password
MAIL_ENV_USERNAME=your_username
MAIL_ENV_PASSWORD=your_email_pw

# Snipe-IT Settings
APP_ENV=production
APP_DEBUG=false
APP_KEY={{INSERT_API_TOKEN}}
APP_URL=http://127.0.0.1:80
APP_TIMEZONE=Europe/London # you should change this to your timezone
APP_LOCALE=en # you should change this for the desired language

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:

http://localhost:3051

Happy asset managing!!!

License

MIT

snipe-it-docker-compose's People

Contributors

comoser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

snipe-it-docker-compose's Issues

New command to generate AND show the APP_KEY

I just had to google how to generate AND show the generated APP_KEY. On the current version (v5.1.7) of SnipeIT, just generating the key won't show you the key to put it into the .env file. I had to add --show to the command:
php artisan key:generate --show

Getting 500 Errors during Pre-Flight

Hello,

I followed your instructions and was able to get an instance of Snipe-IT online. As soon as I start trying to configure the server I get 500 errors though. Any thoughts on what might cause this? I have attempted to enable debugging mode but so far I'm just getting permissions errors it looks like - I think this is related to the debugging and not the actual webpages though.

Thanks!

PHP timezone?

Hello,

I am running snipeit from your docker-compose and I got some errors about permission on /var/www/html/storage/laravel.log

The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log: UnexpectedValueException: The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied The exception occurred while attempting to log:

Accessing app:

Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'locale' (SQL: alter table users add locale varchar(5) null default 'en # you should change this for the desired language')

Running php artisan from docker console:

root@2550a21cb778:/var/www/html# php artisan config:clear
PHP Notice: date_default_timezone_set(): Timezone ID 'Europe/London # you should change this to your timezone' is invalid in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 49
Configuration cache cleared!
root@2550a21cb778:/var/www/html# php artisan migrate
PHP Notice: date_default_timezone_set(): Timezone ID 'Europe/London # you should change this to your timezone' is invalid in /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 49


  • Application In Production!     *
    

Do you really wish to run this command? (yes/no) [no]:

yes

Migrating: 2016_03_10_133849_add_locale_to_users

Illuminate\Database\QueryException

SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'locale' (SQL: alter table users add locale varchar(5) null default 'en # you should change this for the desired language')

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we'll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database's errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }

  +9 vendor frames

10 database/migrations/2016_03_10_133849_add_locale_to_users.php:17
Illuminate\Support\Facades\Facade::__callStatic()

  +22 vendor frames

33 artisan:35
Illuminate\Foundation\Console\Kernel::handle()
root@2550a21cb778:/var/www/html#

How do I solve it?
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.