This repository was archived by the owner on Dec 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (46 loc) · 1.99 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
FROM zaherg/php-xdebug-alpine:latest
ARG BUILD_DATE
ARG VCS_REF
ARG IMAGE_NAME
ARG DOCKER_REPO
LABEL Maintainer="Zaher Ghaibeh <[email protected]>" \
org.label-schema.name=$DOCKER_REPO \
org.label-schema.description="Lightweight container with Nginx 1.12 & PHP-FPM 7.x based on Alpine Linux." \
org.label-schema.url="https://www.zah.me" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vcs-url="https://github.com/linuxjuggler/php-and-nginx.git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.schema-version="1.0.0"
USER root
COPY root/. /
RUN set -ex \
echo "@community http://dl-4.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
echo "@testing http://dl-4.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories && \
apk update && apk upgrade && \
apk add --no-cache git curl openssh-client ca-certificates icu rsyslog logrotate runit libzip-dev curl && \
apk add --no-cache --virtual build-dependencies icu-dev g++ make autoconf && \
cd /tmp && \
curl -Ls https://github.com/nimmis/docker-utils/archive/master.tar.gz | tar xfz - && \
./docker-utils-master/install.sh && \
rm -Rf ./docker-utils-master && \
docker-php-ext-install -j$(nproc) intl opcache && \
sed -i "s|\*.emerg|\#\*.emerg|" /etc/rsyslog.conf && \
sed -i 's/$ModLoad imklog/#$ModLoad imklog/' /etc/rsyslog.conf && \
sed -i 's/$KLogPermitNonKernelFacility on/#$KLogPermitNonKernelFacility on/' /etc/rsyslog.conf && \
sed -i 's/user = www-data/user = nginx/' /usr/local/etc/php-fpm.d/www.conf && \
sed -i 's/group = www-data/group = nginx/' /usr/local/etc/php-fpm.d/www.conf && \
apk add nginx && \
mkdir /web && mkdir /run/nginx && \
rm -rf /var/cache/apk/* && \
apk del build-dependencies && \
rm -rf /tmp/*
# Set environment variables.
ENV HOME /root
# Define working directory.
WORKDIR /root
COPY rootfs /
# VOLUME /web
COPY web /web/html
EXPOSE 80 443
# Define default command.
CMD ["/boot.sh"]