Skip to content

Simplify docker image build process#25

Merged
tdgroot merged 8 commits into
v2from
simplify_docker_image
Aug 9, 2022
Merged

Simplify docker image build process#25
tdgroot merged 8 commits into
v2from
simplify_docker_image

Conversation

@tdgroot
Copy link
Copy Markdown
Member

@tdgroot tdgroot commented Jul 26, 2022

Changes that have been made:

  • Install box without Composer. With this change we didn't need the
    build/ directory anymore, so it was deleted.
  • Just use one PHP image for both build and runtime
  • Install Node.js and NPM using nodesource rather than the Node.js Docker image
  • Removed dep sentry (in the future we need to implement our own APM)
  • Removed dep deployer/recipes, this packages is deprecated and we
    should make use of the recipes within the deployer/deployer package.
  • Base the image on debian:buster image
  • Install PHP and exts from our Hypernode apt repo

This is still a WIP, as we run into dependency problems caused by
Deployer 6.x not having support for PHP ^8.0, see for example
deployphp/deployer#3189.
I think it would be wise to fork Deployer and make the 6.x branch
compatible with PHP ^8.0. When Deployer 7 is released, we can start
making use of that version for the PHP ^8.0 variant and fall back to
Deployer 6.x for PHP 7.x.

Changes that have been made:
- Install box without Composer. With this change we didn't need the
`build/` directory anymore, so it was deleted.
- Just use one PHP image for both build and runtime
- Install Node.js and NPM using nodesource rather than the Node.js Docker image
- Removed dep sentry (in the future we need to implement our own APM)
- Removed dep deployer/recipes, this packages is deprecated and we
should make use of the recipes within the deployer/deployer package.
Comment thread ci/build/Dockerfile Outdated
Comment thread ci/build/Dockerfile Outdated
@tdgroot tdgroot marked this pull request as ready for review August 8, 2022 08:26
@tdgroot tdgroot changed the base branch from master to v2 August 9, 2022 07:39
Copy link
Copy Markdown
Contributor

@AlexanderGrooff AlexanderGrooff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice 👌

Comment thread ci/build/Dockerfile
Comment on lines +25 to +30
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&& echo "deb http://deb.nodesource.com/node_${NODE_VERSION}.x buster main" | tee /etc/apt/sources.list.d/nodesource.list \
&& echo \
"Package: * \
Pin origin deb.nodesource.com \
Pin-Priority: 1001" > /etc/apt/preferences.d/nodejs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this easier compared to just installing node from debian.hypernode.com?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have all the node versions available on our own repo, so that's why I chose to use nodesource directly.

Comment thread composer.json
"deployer/recipes": "dev-master",
"doctrine/annotations": "^1.6",
"hypernode/deploy-configuration": "dev-master",
"hypernode/deploy-configuration": "^1.0.0",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will change again on the deployer v7 PR, but fine for now

@tdgroot tdgroot merged commit fdb156e into v2 Aug 9, 2022
@tdgroot tdgroot deleted the simplify_docker_image branch August 9, 2022 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants