Skip to content

Commit

Permalink
Remove Compose bogus volume; add instructions for deployment via dock…
Browse files Browse the repository at this point in the history
…er-compose (#1)
  • Loading branch information
tsundokul committed Jul 21, 2021
1 parent 07d3315 commit 9c3d0bb
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,35 @@ You can access the main website of the project at [http://consulproject.org](htt

**NOTE**: For more detailed instructions check the [docs](https://docs.consulproject.org)

### a. using docker-compose (recommended)
```bash
git clone https://github.com/consul/consul.git
cd consul
# add the composer-specific database config
cp config/database-docker.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml
# build the required images
docker-compose build
# choose a database password and spawn the containers
POSTGRES_PASSWORD="8p0V1giz&naNz*i6" docker-compose up
# connect to the app container and prepare the database
docker exec -it consul_app_1 bash -li
bin/rake db:create
bin/rake db:migrate
bin/rake db:dev_seed
RAILS_ENV=test rake db:setup
# ready to use -- by default, port 3000 is exposed on host
```
#### Troubleshooting
```bash
# Sometimes a lockfile prevents the containers to be restarted
# in this case, it is safe to just remove it
host$ rm tmp/pids/server.pid
# If the cache gets corrupted simply clean it
host$ rm -rf tmp/cache/*
```

### b. on host
Prerequisites: install git, Ruby 2.6.7, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5).

```bash
Expand All @@ -61,6 +90,7 @@ bin/rails s
Run the tests with:

```bash
# Optionally; it takes a long time to complete
bin/rspec
```

Expand Down
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ services:
- "3000:3000"
# map our application source code, in full, to the application root of our container
volumes:
- .:/var/www/consul:delegated
- ./:/var/www/consul:delegated
- bundle:/usr/local/bundle:delegated
- "$SSH_AUTH_SOCK:/tmp/agent.sock"
environment:
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- SSH_AUTH_SOCK=/tmp/agent.sock
volumes:
docker-example-postgres: {}
bundle: {}

0 comments on commit 9c3d0bb

Please sign in to comment.