Rails app on top of elasticsearch to manage fablab projects
1.6K
2.Install docker and docker-compose. Your system may provide a pre-packaged version of docker in its repositories, but this version may be outdated. Please refer to the official docker documentation to set up a recent version of docker.
Add your current user to the docker group, to allow using docker without sudo.
# add the docker group if it doesn't already exist
sudo groupadd docker
# add the current user to the docker group
sudo usermod -aG docker $(whoami)
# restart to validate changes
sudo reboot
Retrieve the project from Git
git clone https://github.com/sleede/openlab-projects.git
Move into the project directory and install the docker-based dependencies.
⚠ If you are using Mac OS X, you must first edit the docker-compose.yml to use port binding instead of ip-based binding. This can be achieved by uncommenting the "port" directives and commenting the "networks" directives in the docker-compose.yml file. The hosts file must be modified too, accordingly.
⚠
ERROR: Pool overlaps with other one on this address spaceIn this case, you must modify the /etc/hosts and docker-compose.yml files to change the network from 172.19.y.z to 172.x.y.z, where x is a new unused network.
cd openlab-projects
cd .docker
cat hosts | sudo tee -a /etc/hosts
docker-compose up -d
cd -
Init the RVM instance and check it's correctly configured
rvm current | grep -q `cat .ruby-version`@openlab && echo "ok"
# Must print ok, otherwise try "rvm use"
Install bundler in the current RVM gemset
gem install bundler
Install the required ruby gems
bundle install
Create the default configuration file
cp config/database.yml.default config/database.yml
Build the databases.
🛈 Please note: Your password length must be between 8 and 72 characters, otherwise db:setup will be rejected. This is configured in config/initializers/devise.rb
ADMIN_EMAIL='youradminemail' ADMIN_PASSWORD='youradminpassword' rails db:setup
mkdir -p tmp/pids
foreman s
You should now be able to access your local development Fab-manager instance by accessing http://localhost:3300 in your web browser.
You can log in as the default administrator using the credentials defined previously.
Access http://localhost:3300/letter_opener to see the emails received.
This interface is available only in development.
We use docker-compose to run the app in production. See docker/README.md for more details.
mkdir -p /apps/openlab-projects/config/nginx/ssl
cd /apps/openlab-projects
curl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/docker-compose.yml > docker-compose.yml
curl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/env.example > config/env
curl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/nginx.conf > config/nginx/nginx.conf
docker-compose pull
curl -sSL https://raw.githubusercontent.com/sleede/openlab-projects/dev/docker/nginx.ssl.conf > config/nginx/nginx.conf
If any asset has changed, recompile them
rm -rf public/assets/
docker-compose run --rm openlab-projects bundle exec rake assets:precompile
If the database has changed (migration) or any other change occurred, run the specific commands like the "asset precompile" one (eg. bundle exec rake db:migrate).
Finally, restart the container
docker-compose down
docker-compose up -d
to run the test suite:
bundle exec rails test
File.write("#{Rails.root}/_____CHEMIN____/projects.yml", YAML.dump(Project.find_each.map(&:attributes)))
Content type
Image
Digest
Size
417.6 MB
Last updated
over 4 years ago
docker pull sleede/openlab-projects