forked from NafaaAzaiez/symfony-rest-api-init
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·78 lines (61 loc) · 1.88 KB
/
Dockerfile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
ARG PHP_VERSION=7.4
ARG APP_ENV=dev
FROM php:${PHP_VERSION}-fpm-alpine as php_fpm
# persistent / runtime deps
RUN apk add --no-cache \
$PHPIZE_DEPS \
acl \
file \
gettext \
git \
freetype-dev \
bzip2-dev \
icu-dev \
libsodium-dev \
libzip-dev \
; \
docker-php-ext-configure gd --with-freetype=/usr/include/ \
&& docker-php-ext-install bz2 \
&& docker-php-ext-install opcache \
&& docker-php-ext-install intl \
&& docker-php-ext-install zip \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install sodium \
&& docker-php-ext-install bcmath
RUN pecl install apcu \
&& docker-php-ext-enable apcu
COPY docker/php/config/php.ini /usr/local/etc/php/
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug \
; \
pecl clear-cache;
COPY docker/php/config/xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# install composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN set -eux; \
composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative;
WORKDIR /var/www/api
ENV PATH="${PATH}:/root/.composer/vendor/bin"
# copy only specifically what we need
COPY composer.json composer.lock symfony.lock .env* behat.yml.* ./
COPY bin bin/
COPY config config/
COPY features features/
#COPY fixtures fixtures/
COPY public public/
COPY src src/
COPY templates templates/
COPY tests tests/
COPY translations translations/
RUN set -eux; \
composer install --prefer-dist --no-progress --no-suggest;
RUN set -eux; \
mkdir -p var/cache var/log var/data config/jwt; \
chmod +x bin/console; sync
VOLUME /var/www/api/var
COPY docker/php/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
RUN chmod +x /usr/local/bin/docker-entrypoint
EXPOSE 9000
ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"]