Build - every time the Dockerfile changes
docker-compose build
Run:
docker-compose run mysuperawesomeproject
Start and "log into Bash":
docker-compose run mysuperawesomeproject bash
Start and keep running in background:
docker-compose up
| version: '3' | |
| services: | |
| mysuperawesomeproject: | |
| build: . | |
| command: psql -h mydb -U postgres | |
| depends_on: | |
| - mydb | |
| - redis | |
| volumes: | |
| - .:/testdir | |
| environment: | |
| MY_TEST_ENV: the test value | |
| redis: | |
| image: redis:3.0 | |
| mydb: | |
| image: postgres:9.4 | |
| FROM ubuntu:16.04 | |
| RUN apt-get update -qq | |
| RUN apt-get install -y postgresql-client |