forked from jtreminio/php-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-nginx
45 lines (36 loc) · 1.3 KB
/
Dockerfile-nginx
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
ARG PHP_VER_DOT
FROM jtreminio/php:$PHP_VER_DOT
LABEL maintainer="Juan Treminio <jtreminio@gmail.com>"
RUN printf "deb [arch=amd64] http://ppa.launchpad.net/ondrej/nginx/ubuntu bionic main\n" \
>/etc/apt/sources.list.d/ondrej-nginx.list &&\
apt-get update &&\
apt-get install --no-install-recommends --no-install-suggests -y \
nginx \
libnginx-mod-http-perl &&\
apt-get -y --purge autoremove &&\
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/{man,doc}
# Set proper permissions for Nginx
RUN chown -R www-data:www-data \
/var/lib/nginx \
/var/www &&\
install -d -m 0755 -o www-data -g www-data \
/var/cache/nginx \
/var/run/nginx &&\
rm -rf /var/www/html
COPY files/nginx/nginx.conf /etc/nginx/nginx.conf
COPY files/nginx/vhost/* /etc/nginx/sites-available/
RUN rm -f /etc/nginx/sites-enabled/default
# runit config
RUN mkdir /etc/service/nginx
COPY files/nginx/nginx /etc/service/nginx/run
RUN chmod +x /etc/service/nginx/run
RUN mkdir /etc/service/fpm-xdebug
COPY files/php/fpm-xdebug /etc/service/fpm-xdebug/run
RUN chmod +x /etc/service/fpm-xdebug/run &&\
touch /var/log/fpm-xdebug-tail
# Default Nginx vhost to basic FPM config
ENV VHOST=fpm
# Replace 0.0.0.0:9000
ENV FPM.listen="127.0.0.1:9000"
EXPOSE 8080
CMD ["/sbin/my_init"]