forked from francescomalatesta/laravel-ecs-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
69 lines (45 loc) · 1.4 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
FROM ubuntu:xenial
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN apt-get update
RUN apt-get -y install \
software-properties-common \
python-software-properties
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
RUN apt-get update
RUN apt-get -y install \
git \
curl \
zip \
wget \
unzip \
php7.1 \
php7.1-xml \
php7.1-mbstring \
php7.1-mysql \
php7.1-gd \
php7.1-curl \
php7.1-redis \
php7.1-fpm \
php7.1-zip
RUN wget http://nginx.org/keys/nginx_signing.key
RUN apt-key add nginx_signing.key
RUN rm -rf nginx_signing.key
RUN echo 'deb http://nginx.org/packages/ubuntu/ '$(lsb_release -cs)' nginx' > /etc/apt/sources.list.d/nginx.list
RUN apt-get update && apt-get -y install nginx
RUN apt-get clean
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN mkdir -p /app && rm -fr /usr/share/nginx/html && ln -s /app /usr/share/nginx/html
RUN rm -rf /etc/nginx/conf.d/default.conf
ADD nginx/default.conf /etc/nginx/conf.d/default.conf
ADD php/www.conf /etc/php/7.1/fpm/pool.d/www.conf
RUN sed -i "s/user nginx;/user www-data;/g" /etc/nginx/nginx.conf
RUN mkdir /var/run/php
ADD run.sh /run.sh
RUN chmod 755 /run.sh
WORKDIR /app
RUN chmod -R 777 /app
ONBUILD ADD app /app
ONBUILD RUN composer install --no-dev
ONBUILD RUN chown www-data:www-data /app -R
EXPOSE 80
CMD ["/run.sh"]