-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDockerfile
executable file
·87 lines (73 loc) · 2.35 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
FROM ubuntu:18.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN apt-get update && apt-get install -yq --no-install-recommends \
apt-utils \
curl \
# Install git
git \
# Install apache
apache2
# Install php 7.3
RUN apt-get install -y php7.3 \
libapache2-mod-php7.3 \
php7.3-cli \
php7.3-json \
php7.3-curl \
php7.3-fpm \
php7.3-gd \
php7.3-ldap \
php7.3-mbstring \
php7.3-mysql \
php7.3-soap \
php7.3-sqlite3 \
php7.3-xml \
php7.3-zip \
php7.3-intl \
php-imagick \
php-redis \
# Install tools
openssl \
nano \
graphicsmagick \
imagemagick \
ghostscript \
mysql-client \
iputils-ping \
locales \
sqlite3 \
ca-certificates \
zip \
unzip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Add apache config to enable .htaccess and do some stuff you want
COPY apache_default /etc/apache2/sites-available/000-default.conf
# Enable mod rewrite and listen to localhost
RUN a2enmod rewrite && \
echo "ServerName localhost" >> /etc/apache2/apache2.conf
################################################################
# Example, deploy a default CakePHP 3 installation from source #
################################################################
# Clone your application (cloning CakePHP 3 / app instead of composer create project to demonstrate application deployment example)
RUN rm -rf /var/www/apachephp
ADD ./ /var/www/apachephp
WORKDIR /var/www/apachephp
RUN mkdir -p logs tmp
# Copy the app.php file
# Inject some non random salt for this example
RUN sed -i -e "s/__SALT__/somerandomsalt/" config/app.php && \
# Make sessionhandler configurable via environment
sed -i -e "s/'php',/env('SESSION_DEFAULTS', 'php'),/" config/app.php && \
# Set write permissions for webserver
chgrp -R www-data logs tmp webroot && \
chmod -R g+rw logs tmp webroot
RUN composer install
RUN composer dumpautoload
####################################################
# Expose port and run Apache webserver #
####################################################
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]