forked from api-platform/demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
63 lines (54 loc) · 1.71 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
FROM php:7.1-apache
# PHP extensions
ENV APCU_VERSION 5.1.7
RUN buildDeps=" \
libicu-dev \
zlib1g-dev \
" \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
$buildDeps \
libicu52 \
zlib1g \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install \
intl \
mbstring \
pdo_mysql \
zip \
&& apt-get purge -y --auto-remove $buildDeps
RUN pecl install \
apcu-$APCU_VERSION \
&& docker-php-ext-enable --ini-name 05-opcache.ini \
opcache \
&& docker-php-ext-enable --ini-name 20-apcu.ini \
apcu
# Apache config
RUN a2enmod rewrite
ADD docker/apache/vhost.conf /etc/apache2/sites-available/000-default.conf
# PHP config
ADD docker/php/php.ini /usr/local/etc/php/php.ini
# Install Git
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Add the application
ADD . /app
WORKDIR /app
# Fix permissions (useful if the host is Windows)
RUN chmod +x docker/composer.sh docker/start.sh docker/apache/start_safe_perms
# Install composer
RUN ./docker/composer.sh \
&& mv composer.phar /usr/bin/composer \
&& composer global require "hirak/prestissimo:^0.3"
RUN \
# Remove var directory if it's accidentally included
(rm -rf var || true) \
# Create the var sub-directories
&& mkdir -p var/cache var/logs var/sessions \
# Install dependencies
&& composer install --prefer-dist --no-scripts --no-dev --no-progress --no-suggest --optimize-autoloader --classmap-authoritative \
# Fixes permissions issues in non-dev mode
&& chown -R www-data . var/cache var/logs var/sessions
CMD ["/app/docker/start.sh"]