Improve docker build process

This commit is contained in:
Anton Vakhrushev 2018-04-29 13:48:32 +03:00
parent abadb39b84
commit 29cacbbe4f
3 changed files with 10 additions and 3 deletions

1
.env
View File

@ -1,2 +1,3 @@
PHP_BASE_IMAGE=php:7.2-cli
PHP_IMAGE=homepage-php
NODE_IMAGE=node:10

View File

@ -1,4 +1,6 @@
FROM php:7.2-cli
ARG PHP_BASE_IMAGE
FROM ${PHP_BASE_IMAGE}
# Project folder
RUN mkdir -p /srv/app
@ -10,11 +12,11 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*
# get composer and required tools
RUN curl -sLO https://getcomposer.org/download/1.6.3/composer.phar \
RUN curl -sLO https://getcomposer.org/download/1.6.4/composer.phar \
&& mv composer.phar /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer
# Deployer
RUN curl -sLO https://deployer.org/releases/v6.0.3/deployer.phar \
RUN curl -sLO https://deployer.org/releases/v6.2.0/deployer.phar \
&& mv deployer.phar /usr/local/bin/dep \
&& chmod +x /usr/local/bin/dep

View File

@ -2,7 +2,11 @@
source .env
docker pull ${PHP_BASE_IMAGE}
docker pull ${NODE_IMAGE}
docker build \
--file docker/Dockerfile \
--build-arg PHP_BASE_IMAGE=${PHP_BASE_IMAGE} \
--tag ${PHP_IMAGE} \
$PWD