Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

travelsheets/travelsheets-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Documentation

Documentation is available at https://travelsheets.docs.apiary.io/.

Installation

With Docker

  • Clone the project
$ git clone [email protected]:travelsheets/travelsheets-api.git
$ cd travelsheets-api
  • Create your environment settings and edit it
$ cd ./etc/docker
$ cp .env.dist .env
  • Build and run the docker environement
$ docker-compose build
$ docker-compose up -d
  • Update your system host file
$ sudo echo $(docker network inspect bridge | grep Gateway | grep -o -E '[0-9\.]+') "travelsheets.local" >> /etc/hosts
  • Install the application
$ docker-compose exec php bash
$ ./etc/bash/install.sh

Note: jwt_key_pass_phrase is the pass phrase for JWT rsa key.

  • Enjoy !

Usage

Just run docker-compose up -d, then:

  • Symfony app: visit travelsheets.local
  • Symfony dev mode: visit travelsheets.local/app_dev.php
  • Logs (files location): logs/nginx and logs/symfony

You can relaunch installation script to update the project.

Useful commands

# bash commands
$ docker-compose exec php bash

# Composer (e.g. composer update)
$ docker-compose exec php composer update

# SF commands (Tips: there is an alias inside php container)
$ docker-compose exec php php /var/www/symfony/bin/console cache:clear
# Same command by using alias
$ docker-compose exec php bash
$ sf cache:clear

# Retrieve an IP Address (here for the nginx container)
$ docker inspect --format '{{ .NetworkSettings.Networks.dockersymfony_default.IPAddress }}' $(docker ps -f name=nginx -q)
$ docker inspect $(docker ps -f name=nginx -q) | grep IPAddress

# MySQL commands
$ docker-compose exec db mysql -uroot -p"root"

# F***ing cache/logs folder
$ sudo chmod -R 777 var/cache var/logs var/sessions

# Check CPU consumption
$ docker stats $(docker inspect -f "{{ .Name }}" $(docker ps -q))

# Delete all containers
$ docker rm $(docker ps -aq)

# Delete all images
$ docker rmi $(docker images -q)

Contributing

First of all, thank you for contributing ♥ Also, while creating your Pull Request on GitHub, please write a description which gives the context and/or explains why you are creating it.

Bug Tracking

If you want to report a bug or suggest an idea, please use GitHub issues.

MIT License

TravelSheets is completely free and released under the MIT License.

Authors

TravelSheets was originally created by Quentin Machard. See the list of contributors from our community.