Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# base image should be a PHP Debian container, such as php:7.4-buster
ARG PHP_IMG
FROM $PHP_IMG

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_push_to_dockerhub (php:8.0-bullseye)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $PHP_IMG results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_push_to_dockerhub (php:8.1-bullseye)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $PHP_IMG results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_push_to_dockerhub (php:8.2-bookworm)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $PHP_IMG results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_push_to_dockerhub (php:8.3-bookworm)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $PHP_IMG results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_push_to_dockerhub (php:8.4-bookworm)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $PHP_IMG results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

Check warning on line 3 in Dockerfile

View workflow job for this annotation

GitHub Actions / build_push_to_dockerhub (php:7.4-bullseye)

Default value for global ARG results in an empty or invalid base image name

InvalidDefaultArgInFrom: Default value for ARG $PHP_IMG results in empty or invalid base image name More info: https://docs.docker.com/go/dockerfile/rule/invalid-default-arg-in-from/

RUN apt-get update && \
apt-get install -y \
Expand Down Expand Up @@ -64,8 +64,6 @@
python3 \
python3-pip \
rsync \
ruby \
ruby-dev \
shellcheck \
software-properties-common \
sshpass \
Expand All @@ -89,7 +87,7 @@
rm -rf /var/lib/apt/lists/* && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

ENV LANG en_US.utf8
ENV LANG="en_US.utf8"

RUN echo "memory_limit=-1" > "$PHP_INI_DIR/conf.d/memory-limit.ini" && \
echo "date.timezone=${PHP_TIMEZONE:-UTC}" > "$PHP_INI_DIR/conf.d/date_timezone.ini"
Expand All @@ -102,25 +100,20 @@

## set up NVM and install node ##

ENV NVM_DIR /tmp/.nvm
ENV NVM_DIR="/tmp/.nvm"
RUN mkdir ${NVM_DIR}
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash

# Workaround - Cypress installation
ENV CYPRESS_CACHE_FOLDER /tmp/cypress/cache
ENV CYPRESS_CACHE_FOLDER="/tmp/cypress/cache"
RUN mkdir -p ${CYPRESS_CACHE_FOLDER} && chmod 777 ${CYPRESS_CACHE_FOLDER}

ARG NODE_VERSION=16
ARG NODE_VERSION=24
COPY build/install-node.sh /tmp/install-node.sh
RUN chmod +x /tmp/install-node.sh && /tmp/install-node.sh "${NODE_VERSION}"
COPY .bowerrc /root/.bowerrc
RUN chmod +x /tmp/install-node.sh && /tmp/install-node.sh "--lts"

## Compass ##

RUN gem install compass

## Ansible, awscli, other Python tools ##

COPY requirements.txt /tmp/requirements.txt
RUN PIP_BREAK_SYSTEM_PACKAGES=1 python3 -m pip -V && \
PIP_BREAK_SYSTEM_PACKAGES=1 python3 -m pip install --upgrade pip && \
Expand All @@ -129,8 +122,8 @@
## Composer ##
ARG COMPOSER_VERSION 1

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp
ENV COMPOSER_ALLOW_SUPERUSER=""1
ENV COMPOSER_HOME="/tmp"

COPY build/install-composer.sh /tmp/install-composer.sh
RUN /tmp/install-composer.sh && \
Expand Down Expand Up @@ -201,7 +194,7 @@
chmod 700 /root/.ssh

# force CI jobs to source root's .bashrc, which will enable NVM
ENV BASH_ENV "/root/.bashrc"
ENV BASH_ENV="/root/.bashrc"

COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,7 @@
- terminus
- yamllint

**npm packages installed:**
- grunt-cli
- gulp-cli
- bower
- yarn
- lighthouse
- serverless
- firebase-tools
- cypress

Node and npm are managed by the `build/install-node.sh` script.
Node and npm are managed by the `build/install-node.sh` script. The following versions are supported by default: [16, 18, 20, 22]

## Customize Package and Tool Configurations

Expand Down
25 changes: 6 additions & 19 deletions build/install-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,13 @@ echo "Building node environment for version ${NODE_VERSION}"

nvm install "${NODE_VERSION}"

# Cypress version added since latest supports v18.x and above. Setting Cypress version to 13.1.0 according to cypress changelog for supporting node v16.x releases.
# Lighthouse breaking changes for [v11.x / latest](https://github.com/GoogleChrome/lighthouse/releases/tag/v11.0.0), release tag for Aug 4, 2023. Setting latest stable version for node 16 support. (~10.4)
npm install -g \
grunt-cli \
gulp-cli \
bower \
yarn \
lighthouse@~10.4 \
firebase-tools \
cypress@~13.1

# TEMP FIX for issues with installing node 16
# will be addressed in an upcoming version update
if [[ "${NODE_VERSION}" != "16" ]];
then
npm install -g serverless
fi

npm cache clean --force

echo "node ${NODE_VERSION} build completed..."

nvm alias default ${NODE_VERSION}
if [[ "${NODE_VERSION}" =~ "lts" ]];
then
nvm alias default 'lts/*'
else
nvm alias default "${NODE_VERSION}"
fi
Loading