-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
49 lines (40 loc) · 1.33 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
FROM ubuntu:latest
MAINTAINER Romans <[email protected]>
# Install base packages
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && \
apt-get -yq install \
curl \
git \
apache2 \
libapache2-mod-php5 \
php5-mysql \
php5-gd \
php5-curl \
php-pear \
php-apc && \
rm -rf /var/lib/apt/lists/*
RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini
RUN sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/cli/php.ini
RUN sed -i "s/# StrictHostKeyChecking ask/ StrictHostKeyChecking no/g" /etc/ssh/ssh_config
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN a2enmod rewrite
# Add image configuration and scripts
ADD run.sh /run.sh
RUN chmod 755 /*.sh
# Configure /app folder with sample app
RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app/admin/public /var/www/html
# Add application code onbuild
RUN rm -fr /app
ADD . /app
ADD config-dist.php /app/config.php
ADD dam.conf /etc/apache2/sites-enabled/000-default.conf
RUN chown www-data:www-data /app -R
RUN cd /app && composer install
RUN mkdir /var/www/.ssh
RUN chown www-data /var/www/.ssh
# Install or upgrade database
# ONBUILD RUN cd /app && php bootstrap.php
EXPOSE 80
WORKDIR /app
CMD ["/run.sh"]