The command clause does work as @Karthik says above.
As a simple example, the following service will have a -inMemory added to its ENTRYPOINT when docker-compose up is run.
version: '2'
services:
local-dynamo:
build: local-dynamo
image: spud/dynamo
command: -inMemory