document memory requirements of running docker (#9139)

* document memory requirements of running docker

* use bin/compose throughout docker dev description
pull/9145/head
ulferts 4 years ago committed by GitHub
parent 6db1bf2406
commit ba9bd5c5b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      docker/dev/backend/scripts/setup-tests
  2. 28
      docs/development/development-environment-docker/README.md

@ -9,9 +9,9 @@ cp -rp config/frontend_assets.manifest.json public/assets/frontend_assets.manife
echo ""
echo ""
echo "Ready for tests. Run"
echo " docker-compose exec backend-test bundle exec rspec"
echo " bin/compose exec backend-test bundle exec rspec"
echo "to start the full suite, or "
echo " docker-compose exec backend-test bundle exec rspec $tests"
echo " bin/compose exec backend-test bundle exec rspec path/to/some_spec.rb"
echo "to run a subset"
# Keep this container online

@ -24,6 +24,14 @@ Once the containers are done booting you can access the application under http:/
If there is an `.env` file (see below) `bin/compose` will source it.
More details and options follow in the next section.
<div class="alert alert-info" role="alert">
docker-compose needs access to at least 4GB of RAM. E.g. for Mac, this requires to [increase the default limit of the virtualized host.](https://docs.docker.com/docker-for-mac/)
Signs of lacking memory include an "Exit status 137" in the frontend container.
</div>
## Setup
### 1) Checkout the code
@ -54,13 +62,13 @@ directory will not end up with files owned by root.
```
# Start the database. It needs to be running to run migrations and seeders
docker-compose up -d db
bin/compose up -d db
# Install frontend dependencies
docker-compose run frontend npm i
bin/compose run frontend npm i
# Install backend dependencies, migrate, and seed
docker-compose run backend setup
bin/compose run backend setup
```
### 4) Start the stack
@ -68,13 +76,13 @@ docker-compose run backend setup
The docker compose file also has the test containers defined. The easiest way to start only the development stack, use
```
docker-compose up frontend
bin/compose up frontend
```
To see the backend logs as well, use
```
docker-compose up frontend backend
bin/compose up frontend backend
```
This starts only the frontend and backend containers and their dependencies. This excludes the testing containers, which
@ -117,13 +125,19 @@ If you want to reset the data you can delete the docker volumes via `docker volu
Start all linked containers and migrate the test database first:
```
docker-compose up backend-test
bin/compose up backend-test
```
Afterwards, you can start the tests in the running `backend-test` container:
```
docker-compose run backend-test bundle exec rspec
bin/compose run backend-test bundle exec rspec
```
or for running a particular test
```
bin/compose run backend-test bundle exec rspec path/to/some_spec.rb
```
Tests are ran within Selenium containers, on a small local Selenium grid. You can connect to the containers via VNC if

Loading…
Cancel
Save