Skip to content

Commit

Permalink
Add base Dockerfile for Dockerhub builds (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio authored Jan 16, 2020
1 parent c2f7c5e commit 6fcbd60
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor
1 change: 1 addition & 0 deletions .travis/deploy_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if [ "$TRAVIS" = "true" ]; then
.travis
docker
_ide_helper.php
.dockerignore
.dpl
.editorconfig
.eslintignore
Expand Down
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM php:7.4-fpm-alpine

WORKDIR /var/www/

RUN apk add gmp-dev
RUN curl --silent --show-error https://getcomposer.org/installer | php

# Copy any config files in
COPY resources/docker/php/ext-opcache.ini $PHP_INI_DIR/conf.d/
COPY resources/docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf
RUN ln -sf /dev/stderr /var/log/fpm-error.log

RUN docker-php-ext-install \
calendar \
pdo_mysql \
gmp \
opcache && \
docker-php-ext-enable pdo_mysql opcache

COPY . /var/www/
RUN php composer.phar install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist

EXPOSE 9000
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
version: '3'
services:
app:
# For your own docker-compose, use `image: phpvms:latest` instead of the build/context block
build:
context: ./resources/docker/php
context: .
environment:
DB_HOST: mysql
REDIS_HOST: redis
Expand Down
2 changes: 0 additions & 2 deletions resources/docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM php:7.3-fpm-alpine

#RUN apt-get update
#RUN apt-get install -y libgmp-dev
RUN apk add gmp-dev

# Copy any config files in
Expand Down

0 comments on commit 6fcbd60

Please sign in to comment.