build(docker): use alpine for smaller image

This commit is contained in:
Anton Zdanov 2019-03-11 11:59:05 +02:00
parent d12d6ea041
commit a75d76de19
No known key found for this signature in database
GPG Key ID: C2D795DCF85884D4

View File

@ -1,17 +1,17 @@
FROM composer:latest AS composer
FROM composer:1.8 AS composer
COPY ./composer.json /app
COPY composer.json composer.json
RUN composer install --no-dev
RUN composer global require hirak/prestissimo && \
composer install --prefer-dist --no-scripts --no-dev --no-autoloader && \
rm -rf /root/.composer
FROM php:7.1-cli-alpine
FROM php:7.1-cli
COPY --from=composer /app .
WORKDIR /rector
COPY . /rector
COPY --from=composer /app .
CMD ["bin/rector", "process", "/project", "--dry-run", "--config", "/project/rector.yaml"]
# TODO: dev with xdebug extension for local development
ENTRYPOINT [ "bin/rector" ]