-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
42 lines (35 loc) · 1.24 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
FROM php:7.0-fpm
ENV COMPOSER_ALLOW_SUPERUSER 1
# Intall application dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
npm \
zlib1g-dev \
&& \
rm -r /var/lib/apt/lists/*
RUN docker-php-ext-install bcmath pdo pdo_mysql zip
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN ln -s /usr/bin/nodejs /usr/bin/node
RUN npm install -g bower
# Install composer dependencies
RUN mkdir /tmp/composer
COPY composer.json /tmp/composer/composer.json
RUN cd /tmp/composer && \
composer install --no-ansi --no-dev --no-interaction --no-progress --no-scripts --optimize-autoloader
RUN mkdir -p /var/www/html && \
cp -a /tmp/composer/vendor /var/www/html/
# Intall bower dependencies
RUN mkdir /tmp/bower
COPY bower.json /tmp/bower/bower.json
RUN cd /tmp/bower && \
bower install --allow-root --no-color
RUN mkdir -p /var/www/html/public && \
cp -a /tmp/bower/bower_components /var/www/html/public/vendor
# Copy nginx config
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# Copy and chmod application
COPY . /var/www/html
RUN chown -R www-data:www-data /var/www/html
VOLUME ["/etc/nginx/conf.d"]
VOLUME ["/var/www/html"]