Browse Source

fix docker build

master
Artem Shkilev 2 years ago
parent
commit
bf21ddfa14
Signed by: Misterzym
GPG Key ID: 548AD371FC00BF4C
  1. 2
      docker-compose.yml
  2. 12
      docker/php-fpm/Dockerfile
  3. 2
      tests/Feature/ExampleTest.php

2
docker-compose.yml

@ -12,5 +12,3 @@ services:
build:
context: .
dockerfile: ./docker/php-fpm/Dockerfile
volumes:
- ./:/var/www

12
docker/php-fpm/Dockerfile

@ -8,6 +8,10 @@ WORKDIR /var/www
RUN apt-get update && apt-get install -y \
build-essential \
libonig-dev \
libpng-dev \
libjpeg-dev \
libwebp-dev \
libfreetype6-dev \
libzip-dev \
locales \
zip \
@ -16,7 +20,8 @@ RUN apt-get update && apt-get install -y \
curl && apt-get clean && rm -rf /var/lib/apt/lists/*
# Install extensions
RUN docker-php-ext-install mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install gd mbstring zip exif pcntl
# Install composer
#RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
@ -37,8 +42,9 @@ RUN mkdir /etc/composer \
&& chmod a+x /bin/composer
COPY ./ /var/www
RUN composer install
RUN composer install --no-interaction --no-scripts --no-suggest
RUN chmod 775 -R /var/www \
&& chown www:www -R /var/www
USER www
# Expose port 9000 and start php-fpm server
EXPOSE 9000

2
tests/Feature/ExampleTest.php

@ -15,6 +15,6 @@ class ExampleTest extends TestCase
{
$response = $this->get('/');
$response->assertStatus(200);
$response->assertStatus(302);
}
}

Loading…
Cancel
Save