Skip to content

Commit 7b88aa9

Browse files
todstoychevmblaschke
authored andcommitted
Created centos-7 image with php 7 using comunity repo https://centos7.iuscommunity.org/ius-release.rpm (#144)
1 parent 2709d62 commit 7b88aa9

27 files changed

Lines changed: 372 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#+++++++++++++++++++++++++++++++++++++++
2+
# Dockerfile for webdevops/php-nginx:centos-7-php56
3+
# -- automatically generated --
4+
#+++++++++++++++++++++++++++++++++++++++
5+
6+
FROM webdevops/php:centos-7-php56
7+
8+
MAINTAINER info@webdevops.io
9+
LABEL vendor=WebDevOps.io
10+
LABEL io.webdevops.layout=8
11+
LABEL io.webdevops.version=0.57.1
12+
13+
ENV WEB_DOCUMENT_ROOT /app
14+
ENV WEB_DOCUMENT_INDEX index.php
15+
ENV WEB_ALIAS_DOMAIN *.vm
16+
ENV WEB_PHP_SOCKET 127.0.0.1:9000
17+
18+
COPY conf/ /opt/docker/
19+
20+
# Remove php5
21+
RUN yum -y remove php*
22+
23+
# Install php 7
24+
RUN wget https://centos7.iuscommunity.org/ius-release.rpm
25+
RUN /usr/local/bin/yum-install ius-release.rpm
26+
RUN /usr/local/bin/yum-install php70u-*
27+
28+
# Install tools
29+
RUN /usr/local/bin/yum-install \
30+
nginx \
31+
&& /opt/docker/bin/provision run --tag bootstrap --role webdevops-nginx --role webdevops-php-nginx \
32+
&& /opt/docker/bin/bootstrap.sh
33+
34+
RUN rm ius-release.rpm
35+
36+
EXPOSE 80 443
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{ docker.from("php", "centos-7-php70") }}
2+
3+
{{ docker.version() }}
4+
5+
{{ environment.web() }}
6+
{{ environment.webPhp() }}
7+
8+
{{ docker.copy('conf/', '/opt/docker/') }}
9+
10+
{{ nginx.centos('php-nginx') }}
11+
12+
{{ docker.expose('80 443') }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
if [[ ! -e "$WEB_DOCUMENT_ROOT" ]]; then
2+
echo ""
3+
echo "[WARNING] WEB_DOCUMENT_ROOT does not exists with path \"$WEB_DOCUMENT_ROOT\"!"
4+
echo ""
5+
fi
6+
7+
# Replace markers
8+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<DOCUMENT_INDEX>" "$WEB_DOCUMENT_INDEX"
9+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<DOCUMENT_ROOT>" "$WEB_DOCUMENT_ROOT"
10+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<ALIAS_DOMAIN>" "$WEB_ALIAS_DOMAIN"
11+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<SERVERNAME>" "$HOSTNAME"
12+
13+
if [[ -n "${WEB_PHP_SOCKET+x}" ]]; then
14+
## WEB_PHP_SOCKET is set
15+
find /opt/docker/etc/nginx/ -iname '*.conf' -print0 | xargs -0 -r rpl --quiet "<PHP_SOCKET>" "$WEB_PHP_SOCKET"
16+
else
17+
## WEB_PHP_SOCKET is not set, remove PHP files
18+
rm /opt/docker/etc/nginx/conf.d/10-php.conf
19+
rm /opt/docker/etc/nginx/vhost.common.d/10-php.conf
20+
fi
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
source /opt/docker/bin/config.sh
4+
5+
includeScriptDir "/opt/docker/bin/service.d/nginx.d/"
6+
7+
exec /usr/sbin/nginx

docker/php-nginx/centos-7-php70/conf/etc/nginx/conf.d/.gitkeep

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
upstream php {
2+
server <PHP_SOCKET>;
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# deprecated
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include /opt/docker/etc/nginx/global.conf;
2+
include /opt/docker/etc/nginx/php.conf;
3+
include /opt/docker/etc/nginx/conf.d/*.conf;
4+
include /opt/docker/etc/nginx/vhost.conf;
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# For more information on configuration, see:
2+
# * Official English Documentation: http://nginx.org/en/docs/
3+
# * Official Russian Documentation: http://nginx.org/ru/docs/
4+
5+
user nginx;
6+
worker_processes auto;
7+
error_log /var/log/nginx/error.log;
8+
pid /run/nginx.pid;
9+
10+
events {
11+
worker_connections 1024;
12+
}
13+
14+
http {
15+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16+
'$status $body_bytes_sent "$http_referer" '
17+
'"$http_user_agent" "$http_x_forwarded_for"';
18+
19+
access_log /var/log/nginx/access.log main;
20+
21+
sendfile on;
22+
tcp_nopush on;
23+
tcp_nodelay on;
24+
keepalive_timeout 65;
25+
types_hash_max_size 2048;
26+
27+
include /etc/nginx/mime.types;
28+
default_type application/octet-stream;
29+
30+
# Load modular configuration files from the /etc/nginx/conf.d directory.
31+
# See http://nginx.org/en/docs/ngx_core_module.html#include
32+
# for more information.
33+
include /etc/nginx/conf.d/*.conf;
34+
}
35+
daemon off;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# deprecated

0 commit comments

Comments
 (0)