Docker images with everything you'll need to build and test PHP applications.
Based on Official PHP images and edbizarro's Images
CURRENTLY ONLY ALPINE IMAGES!
7.4-alpine
(7.4/alpine/Dockerfile) -8.0-alpine
(8.0/alpine/Dockerfile) -8.1-alpine
(8.1/alpine/Dockerfile) -8.2-alpine
(8.2/alpine/Dockerfile) -8.3-alpine
(8.3/alpine/Dockerfile) -
All versions come with:
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: symfony
MYSQL_PASSWORD: password
MYSQL_DATABASE: project
APP_ENV: prod
DATABASE_URL: mysql://$MYSQL_USER:$MYSQL_PASSWORD@mysql/$MYSQL_DATABASE
image: cstadler333/gitlab-ci-php:8.3-alpine
services:
- mariadb:10.11
build:
stage: build
before_script:
- npm install
script:
- npm run build
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
stages:
- build
- deploy
variables:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: symfony
MYSQL_PASSWORD: password
MYSQL_DATABASE: project
APP_ENV: prod
DATABASE_URL: mysql://$MYSQL_USER:$MYSQL_PASSWORD@mysql/$MYSQL_DATABASE
cache:
key: $CI_COMMIT_REF_NAME
paths:
- node_modules/
- vendor/
image: cstadler333/gitlab-ci-php:8.3-alpine
services:
- mariadb:10.11
.build_template: &build
stage: build
before_script:
- npm install --force
script:
- npm run build
- composer install --prefer-dist --no-ansi --no-interaction --no-progress
.deploy_template: &deploy
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get install -qq openssh-client )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
Build Master:
<<: *build
only:
- master
Deploy Master:
<<: *deploy
only:
- master
script:
- rsync -a --progress --human-readable --delete
--exclude .git
--exclude node_modules
--exclude var
--exclude vendor
.
user@server:path