Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
leenooks
wordpress
Commits
acc6d1c5
Commit
acc6d1c5
authored
Apr 28, 2020
by
Deon George
Browse files
Updated to WP 5.4, added nginx and msmtp
parent
3c194bea
Pipeline
#791
passed with stage
in 1 minute and 57 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Dockerfile
100755 → 100644
View file @
acc6d1c5
# NAME leenooks/wordpress
# VERSION 5.
1.1
-fpm
# VERSION 5.
4
-fpm
FROM
wordpress:5.
1.1
-fpm
FROM
wordpress:5.
4
-fpm
RUN
apt-get update
&&
apt-get
install
-y
openssh-server ssmtp
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
\
&&
useradd
-c
"Hosting Admin User"
-u
1000
-g
users
-G
www-data
-d
/var/www/html
-M
lamp
\
&&
sed
-i
-e
's/^mailhub=mail$/mailhub=smtp/'
-e
"s/^hostname=/#hostname=/"
-e
's/#FromLineOverride=YES/FromLineOverride=YES/'
/etc/ssmtp/ssmtp.conf
RUN
apt-get update
&&
apt-get
install
-y
openssh-server msmtp nginx
\
&&
rm
/etc/nginx/sites-enabled/default
\
&&
apt-get
-y
autoremove
\
&&
apt-get clean
\
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
RUN
docker-php-ext-install
-j
$(
nproc
)
opcache
RUN
useradd
-c
"Hosting Admin User"
-u
1000
-g
users
-G
www-data
-d
/var/www/html
-M
lamp
RUN
sed
-e
's/^expose_php = On/expose_php = Off/'
/usr/local/etc/php/php.ini-production
>
/usr/local/etc/php/php.ini
COPY
www.conf /usr/local/etc/php-fpm.d/
COPY
nginx-app.conf /etc/nginx/conf.d/
COPY
msmtprc /etc/
RUN
sed
-i
-e
's#^;sendmail_path =#sendmail_path = "/usr/bin/msmtp -t"#'
/usr/local/etc/php/php.ini
COPY
sshd_config.patch /tmp
RUN
(
cd
/
&&
patch
-p0
)
< /tmp/sshd_config.patch
&&
rm
/tmp/sshd_config.patch
...
...
@@ -15,5 +26,3 @@ EXPOSE 9000/tcp 22/tcp
COPY
init /sbin
ENTRYPOINT
[ "/sbin/init" ]
CMD
[ "php-fpm" ]
RUN
docker-php-ext-install
-j
$(
nproc
)
opcache
init
View file @
acc6d1c5
#!/bin/sh
if
[
-x
/usr/sbin/sshd
-a
"
${
SSH_START
}
"
=
"TRUE"
]
;
then
NO_NGINX
=
${
NO_NGINX
:-
TRUE
}
SSH_START
=
${
SSH_START
:-
FALSE
}
function
nginx_start
()
{
# Start NGINX
if
[
-x
/usr/sbin/nginx
-a
"
${
NO_NGINX
}
"
!=
"TRUE"
]
;
then
echo
"* Starting NGINX..."
start-stop-daemon
--start
--pidfile
/var/run/nginx.pid
--exec
/usr/sbin/nginx
--
-g
'daemon on; master_process on;'
fi
}
if
[
-x
/usr/sbin/sshd
-a
"
${
SSH_START
}
"
=
"TRUE"
]
;
then
[
!
-d
/var/run/sshd
]
&&
mkdir
/var/run/sshd
start-stop-daemon
--start
--pidfile
/var/run/sshd.pid
--exec
/usr/sbin/sshd
--
-p
22
fi
nginx_start
exec
/usr/local/bin/docker-entrypoint.sh
"
$@
"
msmtprc
0 → 100644
View file @
acc6d1c5
# A system wide configuration file is optional.
# If it exists, it usually defines a default account.
# This allows msmtp to be used like /usr/sbin/sendmail.
account default
# The SMTP smarthost
host smtp
# Envelope-from address
#from user@example.com
domain example.com
# Construct envelope-from addresses of the form "user@oursite.example"
#auto_from on
#maildomain example.com
# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL
nginx-app.conf
0 → 100644
View file @
acc6d1c5
server
{
listen
80
default_server
;
listen
[::]:
80
default_server
;
access_log
none
;
client_max_body_size
10
m
;
error_log
none
;
fastcgi_buffers
16
16
k
;
fastcgi_buffer_size
16
k
;
index
index
.
php
index
.
html
;
root
/
var
/
www
/
html
/
public
;
server_tokens
off
;
set
$
my_https
"off"
;
if
($
http_x_forwarded_proto
=
"https"
) {
set
$
my_https
"on"
;
}
location
/ {
try_files
$
uri
$
uri
/ /
index
.
php
?$
query_string
;
}
location
~ \.
php
$ {
try_files
$
uri
=
404
;
fastcgi_split_path_info
^(.+\.
php
)(/.+)$;
fastcgi_pass
127
.
0
.
0
.
1
:
9000
;
fastcgi_index
index
.
php
;
include
fastcgi_params
;
fastcgi_param
SCRIPT_FILENAME
$
document_root
$
fastcgi_script_name
;
fastcgi_param
SERVER_NAME
$
host
;
fastcgi_param
PATH_INFO
$
fastcgi_path_info
;
fastcgi_param
HTTPS
$
my_https
;
fastcgi_param
PHP_ADMIN_VALUE
"sendmail_path=/usr/sbin/sendmail -i -t"
;
}
}
www.conf
0 → 100644
View file @
acc6d1c5
[
www
]
group
=
www
-
data
listen
=
127
.
0
.
0
.
1
:
9000
pm
=
dynamic
pm
.
max_children
=
25
pm
.
max_spare_servers
=
10
pm
.
min_spare_servers
=
5
pm
.
start_servers
=
10
user
=
www
-
data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment