Skip to content

Commit

Permalink
Add docker-compose merge file for production build (#1822)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
rmunn authored Jun 12, 2024
1 parent 38ec044 commit 037646b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/integrate-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ jobs:
cache: 'pnpm'
-
run: pnpm install
-
name: Prep for production build of legacy app
# docker compose build doesn't allow passing a `--target` parameter, so we have to replace the target in docker-compose.yml
run: "sed -i 's/target: development/target: production/g' docker-compose.yml"
-
name: Build legacy app
run: docker compose build --build-arg ENVIRONMENT=production --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG_APP }} app
run: docker compose -f docker-compose.yml -f docker-compose.production.yml build --build-arg BUILD_VERSION=${{ steps.image.outputs.TAG_APP }} app
-
name: Verify version stamping
run: |
Expand Down
27 changes: 27 additions & 0 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
services:

app:
build:
target: production
args:
- ENVIRONMENT=production
environment:
- ENVIRONMENT=production

lfmerge:
build:
args:
- ENVIRONMENT=production
environment:
- ENVIRONMENT=production

e2e-app:
build:
args:
- ENVIRONMENT=production
environment:
- ENVIRONMENT=production

test-php:
environment:
- ENVIRONMENT=production

0 comments on commit 037646b

Please sign in to comment.