-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.api
35 lines (25 loc) · 936 Bytes
/
Dockerfile.api
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM php:7.4-fpm-alpine
# Install dependencies
RUN apk update && apk add libmcrypt-dev mysql-client \
openssl zip unzip git nano wget libaio-dev
# lumen packages
RUN docker-php-ext-install tokenizer pdo pdo_mysql
# Install extensions
RUN docker-php-ext-install exif pcntl
RUN apk add --no-cache pcre-dev $PHPIZE_DEPS \
&& pecl install redis \
&& docker-php-ext-enable redis.so
# Install composer
ENV COMPOSER_HOME /composer
ENV PATH ./vendor/bin:/composer/vendor/bin:$PATH
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy existing application directory contents
COPY . /var/www
# Set working directory
WORKDIR /var/www
RUN composer install --no-scripts --prefer-dist
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache
# Expose port 9000 and start php-fpm server
EXPOSE 9000
CMD ["php-fpm"]