-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile-7.3
57 lines (48 loc) · 1.61 KB
/
Dockerfile-7.3
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
FROM ghcr.io/deck-app/apache:v7.3
LABEL maintainer Naba Das <hello@get-deck.com>
# Persistent runtime dependencies
# Example RUN apk add --no-cache php7-openssl php7-sysvmsg php7-curl
COPY httpd.conf /etc/apache2/httpd.conf
ARG SERVER_ROOT
RUN sed -i "s#{SERVER_ROOT}#$SERVER_ROOT#g" /etc/apache2/httpd.conf
VOLUME [ "/var/www/" ]
WORKDIR /var/www
ENV PHP_VERSION=7
ADD package.sh /package.sh
COPY php_ini/php3.ini /etc/php${PHP_VERSION}/php.ini
ARG DISPLAY_PHPERROR
RUN if [ ${DISPLAY_PHPERROR} = true ]; then \
sed -i "s#{DISPLAY}#On#g" /etc/php${PHP_VERSION}/php.ini \
;else \
sed -i "s#{DISPLAY}#Off#g" /etc/php${PHP_VERSION}/php.ini \
;fi
## Linux permission issue
ARG USER_ID
ARG GROUP_ID
RUN apk --no-cache add shadow sudo
RUN usermod -u ${USER_ID} apache && groupmod -g ${GROUP_ID} apache
# sudo command without password
RUN echo "apache ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
#Xdebug enable or disable
ARG XDEBUG
RUN if [ ${XDEBUG} = true ]; then \
apk add php${PHP_VERSION}-pecl-xdebug \
&& echo "zend_extension=xdebug" >> /etc/php${PHP_VERSION}/php.ini \
;fi
## apache2 permission issue
RUN touch /env
RUN chown -R apache:apache /env
RUN chown -R apache:apache /usr/sbin/httpd
RUN chown -R apache:apache /etc/service/apache
RUN chown -R apache:apache /sbin/
RUN chown -R apache:apache /etc/service/
RUN chown -R apache:apache /var/run/apache2
RUN chown -R apache:apache /var/log/apache2
USER apache
ARG INSTALL_ADDITIONAL_EXTENSIONS
ENV INSTALL_ADDITIONAL_EXTENSIONS=$INSTALL_ADDITIONAL_EXTENSIONS
RUN if [ -z "$INSTALL_ADDITIONAL_EXTENSIONS" ] ; then \
echo "No additional PHP extensions added" \
;else \
bash /package.sh \
;fi