Sign inSign up

eaudeweb/mac-logging

By eaudeweb

Updated about 8 years ago

# mac-logging

Image
1

1.9K

eaudeweb/mac-logging repository overview

MAC Logging

MAC Logging application is developed in order to provide a tool to detect when people come and go from work, depending on MAC addresses of their personal devices.

Travis Coverage Status Docker

Prerequisites

  1. Install Docker
  2. Install Docker Compose

Installing the application

  1. Get the source code:

     git clone https://github.com/eaudeweb/mac-logging.git
     cd mac-logging
    
  2. Customize env files:

     cp docker/app.env.example docker/app.env
     vim docker/app.env
    
  3. Customize docker orchestration:

     cp docker-compose.override.yml.example docker-compose.override.yml
    
  4. Start stack, all services should be "Up" :

     docker-compose up -d
     docker-compose ps
     
    
  5. Run tests:

     docker exec -it pontaj.app sh
     pip install -r requirements-dev.txt
     py.test --cov=clocking tests
    
  6. See it in action: http://localhost:5000

Upgrading the application

  1. Get the latest version of source code:

     cd mac-logging
     git pull origin master
    
  2. Update the application stack (all services should be "Up") and run migrations:

     docker-compose up -d
     docker-compose ps
     docker exec pontaj.app python manage.py db alembic upgrade head
    
  3. See it in action: http://localhost:5000

Development instructions

In the docker-compose.dev.yml, the project directory is mapped inside the app service container. Make sure you set DEBUG=True in app.env to reload the changes.

  • Start stack, all services should be "Up" :

      docker-compose up -d
      docker-compose ps
    
  • Check application logs:

      docker-compose app
    
  • When the image is modified you should update the stack:

      docker-compose up -d --build
    
  • Delete the containers and the volumes with:

      docker-compose down -v
    

Debugging

  • Please make sure that DEBUG=True in app.env file.

  • Update docker-compose.override.yml file app section with the following so that docker-entrypoint.sh is not executed:

      entrypoint: ["/usr/bin/tail", "-f", "/dev/null"]
    
  • Attach to docker container and start the server in debug mode:

      docker exec -it pontaj.app sh
      python ./manage.py runserver -h 0.0.0.0 -p 5000
    
  • See it in action: http://localhost:5000

Tag summary

Content type

Image

Digest

Size

109.5 MB

Last updated

over 8 years ago

docker pull eaudeweb/mac-logging