-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (61 loc) · 2.39 KB
/
Dockerfile
File metadata and controls
74 lines (61 loc) · 2.39 KB
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
69
70
71
72
73
74
FROM mcr.microsoft.com/oryx/php:7.0-20191018.1
LABEL maintainer="Azure App Services Container Images <appsvc-images@microsoft.com>"
ENV PHP_VERSION 7.0
RUN apt-get update \
&& apt-get install --yes --no-install-recommends \
curl \
net-tools \
dnsutils \
tcpdump \
iproute2
COPY init_container.sh /bin/
COPY hostingstart.html /home/site/wwwroot/hostingstart.html
RUN if [[ "$PHP_VERSION" == "5.6" || "$PHP_VERSION" == "7.0" ]] ; then \
apt-get install -y libmcrypt-dev \
&& docker-php-ext-install mcrypt; \
fi
RUN chmod 755 /bin/init_container.sh \
&& mkdir -p /home/LogFiles/ \
&& echo "root:Docker!" | chpasswd \
&& echo "cd /home" >> /root/.bashrc \
&& ln -s /home/site/wwwroot /var/www/html \
&& mkdir -p /opt/startup
# configure startup
COPY sshd_config /etc/ssh/
COPY ssh_setup.sh /tmp
RUN mkdir -p /opt/startup \
&& chmod -R +x /opt/startup \
&& chmod -R +x /tmp/ssh_setup.sh \
&& (sleep 1;/tmp/ssh_setup.sh 2>&1 > /dev/null) \
&& rm -rf /tmp/*
ENV PORT 8080
ENV SSH_PORT 2222
EXPOSE 2222 8080
COPY sshd_config /etc/ssh/
ENV WEBSITE_ROLE_INSTANCE_ID localRoleInstance
ENV WEBSITE_INSTANCE_ID localInstance
ENV PATH ${PATH}:/home/site/wwwroot
RUN sed -i 's!ErrorLog ${APACHE_LOG_DIR}/error.log!ErrorLog /dev/stderr!g' /etc/apache2/apache2.conf
RUN sed -i 's!User ${APACHE_RUN_USER}!User www-data!g' /etc/apache2/apache2.conf
RUN sed -i 's!User ${APACHE_RUN_GROUP}!Group www-data!g' /etc/apache2/apache2.conf
RUN { \
echo 'DocumentRoot /home/site/wwwroot'; \
echo 'DirectoryIndex default.htm default.html index.htm index.html index.php hostingstart.html'; \
echo 'CustomLog /dev/stderr combined'; \
echo '<FilesMatch "\.(?i:ph([[p]?[0-9]*|tm[l]?))$">'; \
echo ' SetHandler application/x-httpd-php'; \
echo '</FilesMatch>'; \
} >> /etc/apache2/apache2.conf
RUN rm -f /usr/local/etc/php/conf.d/php.ini \
&& { \
echo 'error_log=/dev/stderr'; \
echo 'display_errors=Off'; \
echo 'log_errors=On'; \
echo 'display_startup_errors=Off'; \
echo 'date.timezone=UTC'; \
echo 'zend_extension=opcache'; \
} > /usr/local/etc/php/conf.d/php.ini
RUN rm -f /etc/apache2/conf-enabled/other-vhosts-access-log.conf
RUN rm /etc/apache2/sites-enabled/000-default.conf
WORKDIR /home/site/wwwroot
ENTRYPOINT ["/bin/init_container.sh"]