Skip to content

Commit

Permalink
feat(environment): allow to specify container runtime environment var…
Browse files Browse the repository at this point in the history
…iables
  • Loading branch information
claimableperch committed Oct 29, 2024
1 parent 1f3d491 commit dd32ea4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/modules/createConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || {},
},
);

Expand Down
3 changes: 3 additions & 0 deletions lib/templates/docker-compose.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => { %>
Expand Down

0 comments on commit dd32ea4

Please sign in to comment.