Skip to content

devcongress/jobs

Repository files navigation

Build Status View performance data on Skylight View performance data on Skylight View performance data on Skylight View performance data on Skylight

DevCongress Jobs

This is the code which runs the DevCongress Jobs website, which lives at jobs.devcongress.org

Design specs available here

Docker setup

Requirements

Install Docker and Docker Compose (Docker Compose comes with Docker on Windows and MacOS)

Alternative for windows

If your docker installation fails, you can install rails, ruby and postgress. Installing ubuntu on windows also makes your setup easier. After which you can do the following to get your project running

  • Run bundle install
  • Run rake db:create to create your db
  • Run bin/rails db:migrate RAILS_ENV=development to migrate your db
  • Serve your project

Build

On first install, you will need to run a build to setup any dependencies and get you started.

Any application code changes are automatically reloaded, however, changes to certain files e.g. Dockerfile require a build.

Linux/Mac

  • ./scripts/build.sh

Others

  • docker-compose build --no-cache: rebuild containers
  • docker-compose run --rm web bundle exec rails db:migrate db:seed: apply migrations and seed the database

Run

Linux/Mac

  • ./scripts/start.sh

Others

  • docker-compose up --build: build and start containers

If you'd rather run it in the background,

  • docker-compose up --build -d: build and start containers in detached mode

Develop

The application runs at http://localhost:3000/

You can login with the default user created during seeding

Emails

Mailcatcher is setup in development. You can view all outbound emails at http://localhost:1080/

Helpful Commands

  • docker-compose stop: stop the running containers.
  • docker-compose start: start stopped containers.
  • docker-compose down: stop and remove containers and networks. you will need to recreate them using up

NOTE: all docker-compose commands should be run from the project directory

TIP: To remove any persisted data, delete the .volumes directory.

Migrations

  • docker-compose stop: stop any running containers to prevent contention over database files
  • docker-compose run --rm web bundle exec rails db:migrate: apply migrations

Seeding

  • docker-compose stop: stop any running containers to prevent contention over database files
  • docker-compose run --rm web bundle exec rails db:seed: seed database

Testing

  • docker-compose stop: stop any running containers to prevent contention over database files
  • docker-compose run --rm web bundle exec rails test: run tests

Troubleshooting

For consistency sake, be using the latest stable versions of docker-compose and docker

Linux

Scenario: ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?

Solution: Run sudo usermod -aG docker ${USER}. More details