-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (32 loc) · 1.24 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
FROM amazonlinux:2
# install nginx
RUN amazon-linux-extras install php7.3 nginx1
# install necessary package
RUN yum -y update
RUN yum -y install file zip wget \
&& yum -y install php-mbstring php-intl php-xml php-gd php-pear php-devel gcc make \
&& yum clean all \
&& rm -rf /var/cache/yum
# install xdebug
RUN pecl install xdebug
# install composer
RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/92769472d2d1457c681e9e01ba95e4c36054e86e/web/installer -O - -q | php -- --quiet
RUN mv composer.phar /usr/local/bin/composer
RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash -
RUN yum install nodejs -y
# Config for PHP
COPY nginx/php.ini /etc/
## change uid, gid for apache
RUN usermod -u 1000 apache && groupmod -g 1000 apache
RUN chown apache:apache /var/lib/php/session
# Config for nginx
COPY nginx/conf.d/server.conf /etc/nginx/conf.d/
COPY nginx/nginx.conf /etc/nginx/nginx.conf
# SSL for nginx
RUN openssl req -x509 -sha256 -nodes -days 3650 -newkey rsa:2048 -subj /CN=localhost -keyout localhost.key -out localhost.crt
RUN cp -p localhost.crt /etc/nginx/localhost.crt
RUN cp -p localhost.key /etc/nginx/localhost.key
EXPOSE 443 80
COPY startup.sh /startup.sh
RUN chmod 744 /startup.sh
CMD ["/startup.sh"]