Skip to content

Commit 037646b

Browse files
authored
Add docker-compose merge file for production build (#1822)
* Add docker-compose merge file for production build This will allow the default docker-compose.yml file to build the development build, but allow passing an extra `-f` flag to docker compose in order to build the production build instead. * Remove redundant build-arg parameter in CI The docker-compose.production.yml file already defines the ENVIRONMENT build arg (and env var) everywhere required, so the command-line arg to docker compose is now redundant.
1 parent 38ec044 commit 037646b

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

.github/workflows/integrate-and-deploy.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,9 @@ jobs:
6262
cache: 'pnpm'
6363
-
6464
run: pnpm install
65-
-
66-
name: Prep for production build of legacy app
67-
# docker compose build doesn't allow passing a `--target` parameter, so we have to replace the target in docker-compose.yml
68-
run: "sed -i 's/target: development/target: production/g' docker-compose.yml"
6965
-
7066
name: Build legacy app
71-
run: docker compose build --build-arg ENVIRONMENT=production --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG_APP }} app
67+
run: docker compose -f docker-compose.yml -f docker-compose.production.yml build --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG_APP }} app
7268
-
7369
name: Verify version stamping
7470
run: |

docker-compose.production.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
services:
2+
3+
app:
4+
build:
5+
target: production
6+
args:
7+
- ENVIRONMENT=production
8+
environment:
9+
- ENVIRONMENT=production
10+
11+
lfmerge:
12+
build:
13+
args:
14+
- ENVIRONMENT=production
15+
environment:
16+
- ENVIRONMENT=production
17+
18+
e2e-app:
19+
build:
20+
args:
21+
- ENVIRONMENT=production
22+
environment:
23+
- ENVIRONMENT=production
24+
25+
test-php:
26+
environment:
27+
- ENVIRONMENT=production

0 commit comments

Comments
 (0)