-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
160 lines (132 loc) · 4.98 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
FROM centos:centos7
MAINTAINER Omer Faruk Kesmez <omer.faruk.kesmez@gmail.com>
# php-fpm download
RUN yum update -y && \
yum install -y epel-release
RUN yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm && \
yum install -y yum-utils && \
yum-config-manager --enable remi-php74 && \
yum -y update
RUN yum install -y php-fpm \
php-bcmath \
php-gd \
php-intl \
php-json \
php-ldap \
php-mbstring \
php-mcrypt \
php-opcache \
php-pdo \
#php-pecl-mongo \
php-pecl-mongodb \
php-pear \
php-pecl-apcu \
php-pecl-imagick \
php-pecl-redis \
php-pecl-xdebug \
php-pgsql \
php-mysqlnd \
php-soap \
php-tidy \
php-xml \
php-pecl-zip \
php-xmlrpc && \
yum clean all
RUN useradd -M -d /opt/app -s /bin/false nginx
RUN mkdir -p /run/php-fpm && \
chown nginx:nginx /run/php-fpm
RUN mkdir -p /var/lib/php/session && \
chown nginx:nginx /var/lib/php/session
ADD configs/php-fpm/www.conf /etc/php-fpm.d/
# composer download
RUN curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer
# nginx download
ENV nginxversion="1.19.0-1" \
os="centos" \
osversion="7" \
elversion="7"
RUN yum install -y wget openssl sed &&\
yum -y autoremove &&\
yum clean all &&\
wget http://nginx.org/packages/mainline/$os/$osversion/x86_64/RPMS/nginx-$nginxversion.el$elversion.ngx.x86_64.rpm &&\
rpm -iv nginx-$nginxversion.el$elversion.ngx.x86_64.rpm
# php.ini
COPY configs/php-fpm/php.ini /etc/php.ini
# Laravel files put in docker
COPY framework /data/www/
COPY configs/laravel-root/bootstrap /data/www/bootstrap/
COPY configs/laravel-root/storage /data/www/storage/
# Put nginx config for Laravel
COPY configs/ssl/ssl.crt /etc/ssl/ssl.crt
COPY configs/ssl/ssl.key /etc/ssl/ssl.key
# Laravel dir and file permissions define
RUN chmod -R 777 /data/www/storage
RUN chmod -R 777 /data/www/bootstrap
#php artisan ve composer command verileri çalıştırılıyor.
COPY configs/recompile.sh /recompile.sh
RUN chmod -R 777 /recompile.sh
# Crontab
#RUN yum install -y cronie && yum clean all
RUN rm -rf /etc/localtime
RUN ln -s /usr/share/zoneinfo/Europe/Istanbul /etc/localtime
# Crontab schedule tanımlanıyor
#RUN crontab -l | { cat; echo "* * * * * /usr/bin/php /data/www/artisan schedule:run >> /dev/null 2>&1"; } | crontab -
# Supervisior tanımlamaları
#ENV SUPERVISOR_VERSION=4.0.2
#
#RUN \
# rpm --rebuilddb && yum clean all; \
# yum install -y epel-release; \
# yum update -y; \
# yum install -y \
# iproute \
# python-setuptools \
# hostname \
# inotify-tools \
# yum-utils \
# which \
# jq \
# rsync \
# telnet \
# htop \
# atop \
# iotop \
# mtr \
# python-meld3 \
# python-pip \
# vim && \
# yum clean all && rm -rf /tmp/yum*; \
# #easy_install pip; \
# pip install supervisor==${SUPERVISOR_VERSION}
#
#RUN mkdir -p /data/conf /data/run /data/logs
#RUN chmod 711 /data/conf /data/run /data/logs
#COPY configs/supervisor /
#COPY configs/supervisor/laravel-worker.conf /etc/supervisor.d/laravel-worker.conf
# Supervisior son
#Postgresql indiriliyor
#RUN yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
#RUN yum install -y postgresql13-server
# imageMagick
#RUN yes | yum install php-devel
#RUN yes | yum install gcc
#RUN yes | yum install ImageMagick
#RUN yes | yum install ImageMagick-devel
#RUN yes | yum install libwebp-tools
##RUN pecl install imagick
#RUN echo "extension=imagick.so" > /etc/php.d/imagick.ini
#RUN yes | yum install php71 php71-php-common php71-php-fpm
#RUN yes | yum install php71-php-mysql php71-php-pecl-memcache php71-php-pecl-memcached php71-php-gd php71-php-mbstring php71-php-mcrypt php71-php-xml php71-php-pecl-apc php71-php-cli php71-php-pear php71-php-pdo php71-php-bcmath php71-php-intl php71-php-json php71-php-ldap php71-php-opcache php71-php-pecl-mongodb php71-php-pear php71-php-pecl-apcu php71-php-pecl-imagick php71-php-pecl-redis php71-php-pecl-xdebug php71-php-pgsql php71-php-mysqlnd php71-php-soap php71-php-tidy php71-php-pecl-zip php71-php-xmlrpc
#COPY configs/php-fpm/71www.conf /etc/opt/remi/php71/php-fpm.d/www.conf
#COPY configs/php-fpm/71php.ini /etc/opt/remi/php71/php.ini
#RUN chown nginx:nginx /var/opt/remi/php71/run/php-fpm
#RUN chown nginx:nginx /var/opt/remi/php71/lib/php/session
# nginx setting
RUN mkdir -p /etc/nginx/conf.d
COPY configs/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
COPY configs/nginx/nginx.conf /etc/nginx/nginx.conf
VOLUME [ "/data/www" ]
EXPOSE 80
EXPOSE 443
CMD tr -d '\r' < recompile.sh > recompile2.sh; sh recompile2.sh; /usr/sbin/nginx -c /etc/nginx/nginx.conf; usr/sbin/php-fpm --nodaemonize
#CMD tr -d '\r' < recompile.sh > recompile2.sh; sh recompile2.sh; supervisord -c /etc/supervisord.conf; /usr/sbin/nginx -c /etc/nginx/nginx.conf; usr/sbin/php-fpm --nodaemonize