context or workdir for docker-compose
I think you're looking for working_dir
. Search for "working_dir" in the docker-compose reference.
You can specify the working directory as follows.
version: '2'
services:
test:
build:
context: /path/to/source/dir/
dockerfile: /path/to/custom-Dockerfile/relative/tocontextdir/Dockerfile
working_dir: /app