Skip to content

Commit dd32ea4

Browse files
feat(environment): allow to specify container runtime environment variables
1 parent 1f3d491 commit dd32ea4

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/modules/createConfig.js

+1
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ const createConfig = async (packageDir, hasVolumeSupport = true) => {
142142
port: config.port || 80,
143143
dbPort: config.dbPort || 3306,
144144
volumes: hasVolumeSupport ? volumes : false,
145+
env: config.env || {},
145146
},
146147
);
147148

lib/templates/docker-compose.ejs

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ services:
44
depends_on:
55
- db
66
build: .
7+
environment:
8+
CYPRESS_TEST: 1 <% Object.entries( env ).forEach(([n,v]) => { %>
9+
<%= n %> : <%= v %> <% }); %>
710
ports:
811
- <%= port %>:80
912
<% if (volumes) { %>volumes: <% volumes.forEach((volume) => { %>

0 commit comments

Comments
 (0)