I'm using docker-compose to create a few containers for an app.
- php/nginx <- holds app code, where the tests need to run
- adminer <- only for local dev
I'm really confused about how to fit testing into the build process.
I'll have unit tests and acceptance tests which will require dev php dependencies(ex. phpunit). This means the container will need certain env vars(ex. APP_ENV=test) and i'll need the php dev dependencies. So i think i need to create 2 containers. One to run my tests in and another actual prod version that uses the composer install –no-dev –optimize-autoloader with different env vars that will be pushed to docker hub.
Is this normal? Feels weird but i can't think of any another ways of how this could be done.