docker-compose -f docker-compose-dev.yml build docker-compose -f docker-compose-dev.yml up -d docker exec -it testdriven-app_users_1 sh
docker-compose -f docker-compose-dev.yml build --no-cache docker-compose -f docker-compose-dev.yml up -d --build
pip install -r requirements.txt
Recreate db: $ docker-compose -f docker-compose-dev.yml run users python manage.py recreate_db
Seed db: $ docker-compose -f docker-compose-dev.yml run users python manage.py seed_db
Connect to db: $ docker-compose -f docker-compose-dev.yml exec users-db psql -U postgres
Shell: $ docker-compose -f docker-compose-dev.yml run users flask shell
Test: $ docker-compose -f docker-compose-dev.yml run users python manage.py test
Coverage: $ docker-compose -f docker-compose-dev.yml run users python manage.py cov
Lint: $ docker-compose -f docker-compose-dev.yml run users flake8 project
Create a new AWS EC2 Docker host with Docker Machine:
$ docker-machine create --driver amazonec2 testdriven-prod
Point to production host:
$ docker-machine env testdriven-prod
$ eval
$ docker-compose -f docker-compose-prod.yml up -d --build $ docker-compose -f docker-compose-prod.yml run users python manage.py recreate_db $ docker-compose -f docker-compose-prod.yml run users python manage.py seed_db $ docker-compose -f docker-compose-prod.yml run users python manage.py test
Show config: $ docker-compose -f docker-compose-prod.yml run users env
To show configuration: Add a print statement to init.py, right before the route handler, to view the app config to ensure that it is working: import sys print(app.config, file=sys.stderr) $ docker-compose -f docker-compose-dev.yml logs
Problems with mounting volume on Windows:
- Docker Setting -> Shared Drive -> Reset credentials.
OR
- Local Security Policy > Network List Manager Policies and Double-clicked ‘unidentified Networks’ and change the location type to ‘private’ https://forums.docker.com/t/volume-mounts-in-windows-does-not-work/10693/92
npm start
npm test
react-scripts test --coverage
docker-compose -f docker-compose-dev.yml up --build -d client
docker-compose -f docker-compose-dev.yml run client npm test
$ docker-machine env testdriven-prod-2
$ eval