diff --git a/lib/modules/createConfig.js b/lib/modules/createConfig.js index 8a5339c..8af2f13 100644 --- a/lib/modules/createConfig.js +++ b/lib/modules/createConfig.js @@ -142,6 +142,7 @@ const createConfig = async (packageDir, hasVolumeSupport = true) => { port: config.port || 80, dbPort: config.dbPort || 3306, volumes: hasVolumeSupport ? volumes : false, + env: config.env || {}, }, ); diff --git a/lib/templates/docker-compose.ejs b/lib/templates/docker-compose.ejs index 80eb3b5..48723ad 100644 --- a/lib/templates/docker-compose.ejs +++ b/lib/templates/docker-compose.ejs @@ -4,6 +4,9 @@ services: depends_on: - db build: . + environment: + CYPRESS_TEST: 1 <% Object.entries( env ).forEach(([n,v]) => { %> + <%= n %> : <%= v %> <% }); %> ports: - <%= port %>:80 <% if (volumes) { %>volumes: <% volumes.forEach((volume) => { %>