Skip to content

Commit

Permalink
Merge pull request #6 from elecena/add-composer
Browse files Browse the repository at this point in the history
Add composer to the image
  • Loading branch information
macbre authored Apr 16, 2020
2 parents 900120a + cb6df47 commit 64815c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# elecena.pl (c) 2015-2020

# @see https://hub.docker.com/_/composer
FROM composer:1.10.5 AS php-composer

# @see https://hub.docker.com/_/python/
FROM python:3.8-alpine
RUN pip install virtualenv && rm -rf /root/.cache

# copy composer from the first stage
COPY --from=php-composer /usr/bin/composer /usr/bin

# install dependencies
RUN apk update && apk add \
php7 \
Expand Down Expand Up @@ -38,12 +44,12 @@ RUN apk update && apk add \
php7-xmlwriter \
php7-xml \
php7-xsl \
&& rm -rf /tmp /var/log/* /var/cache/*
&& rm -rf /tmp/* /var/log/* /var/cache/*

ENV PHP_VERSION 7.3.16

# add an info script
WORKDIR /opt

RUN echo "echo -e '### Python'; python -V; virtualenv --version; echo -e '\n### PHP'; php -v; php -m" > info.sh
RUN echo "echo -e '### Python'; python -V; virtualenv --version; echo -e '\n### PHP'; php -v; composer -V; php -m" > info.sh
RUN chmod 744 info.sh
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ docker pull elecena/python-php

```
REPOSITORY TAG IMAGE ID CREATED SIZE
elecena/python-php 3.8-7.3-alpine c9cc8676df95 36 minutes ago 139MB
elecena/python-php 3.8-7.3-alpine-composer c9cc8676df95 6 minutes ago 141MB
```

## Installed software
Expand All @@ -28,6 +28,7 @@ PHP 7.3.16 (cli) (built: Mar 20 2020 11:26:40) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.16, Copyright (c) 1999-2018, by Zend Technologies
Composer version 1.10.5 2020-04-10 11:44:22
[PHP Modules]
calendar
Core
Expand Down

0 comments on commit 64815c0

Please sign in to comment.