Docker/compose updates (#1280)

* Docker/compose updates

* Fix container name

* Add zip to the ext install

* Don't mount the env.php file

* Use newer "docker compose" command

* Install composer

* Remove chown
This commit is contained in:
Nabeel S
2021-09-29 10:14:46 -04:00
committed by GitHub
parent f3b032e56b
commit 0b27635fcb
3 changed files with 13 additions and 9 deletions

View File

@@ -1,8 +1,11 @@
FROM php:7.4-fpm-alpine FROM php:8.0.9-fpm-alpine3.14
WORKDIR /var/www/ WORKDIR /var/www/
RUN apk add gmp-dev icu-dev zlib-dev libpng-dev # Setup composer
COPY --from=composer:2.1.5 /usr/bin/composer /usr/local/bin/composer
RUN apk add gmp-dev icu-dev zlib-dev libpng-dev libzip-dev zip
RUN curl --silent --show-error https://getcomposer.org/installer | php RUN curl --silent --show-error https://getcomposer.org/installer | php
# Copy any config files in # Copy any config files in
@@ -16,17 +19,19 @@ RUN docker-php-ext-install \
pdo_mysql \ pdo_mysql \
gd \ gd \
gmp \ gmp \
opcache && \ bcmath \
docker-php-ext-enable pdo_mysql opcache opcache \
zip && \
docker-php-ext-enable pdo_mysql opcache bcmath zip
COPY . /var/www/ COPY . /var/www/
RUN php composer.phar install \ RUN composer install \
--ignore-platform-reqs \ --ignore-platform-reqs \
--no-interaction \ --no-interaction \
--no-plugins \ --no-plugins \
--no-scripts \ --no-scripts \
--prefer-dist --prefer-dist
RUN chown -R www-data:www-data /var/www #RUN chown -R www-data:www-data /var/www
EXPOSE 9000 EXPOSE 9000

View File

@@ -102,7 +102,7 @@ reset-installer:
.PHONY: docker-test .PHONY: docker-test
docker-test: docker-test:
@docker-compose -f docker-compose.yml -f docker-compose.local.yml up @docker compose -f docker-compose.yml -f docker-compose.local.yml up
.PHONY: docker-clean .PHONY: docker-clean
docker-clean: docker-clean:

View File

@@ -24,9 +24,8 @@ services:
- ./tests:/var/www/tests - ./tests:/var/www/tests
- ./composer.json:/var/www/composer.json - ./composer.json:/var/www/composer.json
- ./composer-lock.json:/var/www/composer-lock.json - ./composer-lock.json:/var/www/composer-lock.json
- ./env.php:/var/www/env.php #- ./env.php:/var/www/env.php
- ./resources/docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf - ./resources/docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./vendor:/var/www/vendor
depends_on: depends_on:
- mysql - mysql
- redis - redis