This is the code which runs the DevCongress Jobs website, which lives at jobs.devcongress.org
Design specs available here
Install Docker and Docker Compose (Docker Compose comes with Docker on Windows and MacOS)
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
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.
./scripts/build.sh
docker-compose build --no-cache
: rebuild containersdocker-compose run --rm web bundle exec rails db:migrate db:seed
: apply migrations and seed the database
./scripts/start.sh
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
The application runs at http://localhost:3000/
You can login with the default user created during seeding
- email: [email protected]
- password: password1
Mailcatcher is setup in development. You can view all outbound emails at http://localhost:1080/
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 usingup
NOTE: all
docker-compose
commands should be run from the project directory
TIP: To remove any persisted data, delete the .volumes directory.
docker-compose stop
: stop any running containers to prevent contention over database filesdocker-compose run --rm web bundle exec rails db:migrate
: apply migrations
docker-compose stop
: stop any running containers to prevent contention over database filesdocker-compose run --rm web bundle exec rails db:seed
: seed database
docker-compose stop
: stop any running containers to prevent contention over database filesdocker-compose run --rm web bundle exec rails test
: run tests
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