Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Test project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Жуков Николай Николаевич
Test project
Commits
530cba67
Commit
530cba67
authored
Mar 02, 2021
by
Nick Zhukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grav-test-image
parent
9aa7ad70
Pipeline
#6749
failed with stages
in 4 minutes and 48 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
0 deletions
+121
-0
Dockerfile
Dockerfile
+90
-0
run
run
+31
-0
No files found.
Dockerfile
0 → 100644
View file @
530cba67
FROM
phusion/baseimage:master-amd64
MAINTAINER
Ahumaro Mendoza <ahumaro@ahumaro.com>, Dmitrii Zolotov <dzolotov@herzen.spb.ru>
CMD
["/sbin/my_init"]
ENV
HOME /root
ENV
DEBIAN_FRONTEND noninteractive
#Install core packages
RUN
apt-get update
-q
-y
&&
apt
install
-y
logrotate
&&
apt-get upgrade
-y
-q
&&
apt-get
install
-y
-q
php php-mbstring php-zip
\
php-dom php-cli php-fpm php-gd php-curl php-apcu ca-certificates nginx git-core php-ctype php-json php-imagick openssh-server
\
php-fdomdocument php-fxsl php-simplexml php-xml php-opcache php-yaml php-xdebug
&&
\
apt-get clean
-q
&&
rm
-rf
/var/lib/apt/lists/
*
/tmp/
*
/var/tmp/
*
#Get Grav
RUN
rm
-fR
/usr/share/nginx/html/
&&
git clone https://github.com/getgrav/grav.git /usr/share/nginx/html/
#Install Grav
WORKDIR
/usr/share/nginx/html/
RUN
bin/composer.phar self-update
RUN
bin/grav
install
RUN
chown
www-data:www-data
.
&&
chown
-R
www-data:www-data
*
RUN
find
.
-type
f | xargs
-d
'\n'
chmod
664
RUN
find
.
-type
d | xargs
-d
'\n'
chmod
775
RUN
find
.
-type
d | xargs
-d
'\n'
chmod
+s
RUN
umask
0002
&&
chmod
777
-R
assets
&&
\
chmod
+x bin/gpm
RUN
sed
-i
's/allow_url_fopen.*/allow_url_fopen = Off/ig'
/etc/php/7.4/cli/php.ini
&&
\
sed
-i
's/allow_url_fopen.*/allow_url_fopen = Off/ig'
/etc/php/7.4/fpm/php.ini
&&
\
sed
-i
's/session.gc_maxlifetime.*/session.gc_maxlifetime = 6048000/ig'
/etc/php/7.4/cli/php.ini
&&
\
sed
-i
's/session.gc_maxlifetime.*/session.gc_maxlifetime = 6048000/ig'
/etc/php/7.4/fpm/php.ini
RUN
bin/gpm
install
-y
admin admin-addon-user-manager core-service-manager
&&
echo
"Europe/Moscow"
>
/etc/timezone
&&
dpkg-reconfigure tzdata
#youtube snappygrav toc tidyhtml shortcodes \
# markdown-color logerrors instagram markdown-sections leaflet data-manager \
# breadcrumbs highlight pagination random simplesearch taxonomylist github lightslider \
# relatedpages page-inject external_links mathjax filesource qrcode \
# table-importer editor && \
#Configure Nginx - enable gzip
RUN
sed
-i
's|# gzip_types| gzip_types|'
/etc/nginx/nginx.conf
RUN
sed
-i
's/7.2/7.4/ig'
/usr/share/nginx/html/webserver-configs/nginx.conf
#Setup Grav configuration for Nginx
RUN
touch
/etc/nginx/grav_conf.sh
&&
chmod
+x /etc/nginx/grav_conf.sh
&&
echo
'#!/bin/bash \n
\
echo "" > /etc/nginx/sites-available/default \n
\
ok="0" \n
\
while IFS="" read line \n
\
do \n
\
if [ "$line" = "server {" ]; then \n
\
ok="1" \n
\
fi \n
\
if [ "$ok" = "1" ]; then \n
\
echo "$line" >> /etc/nginx/sites-available/default \n
\
fi \n
\
if [ "$line" = "}" ]; then \n
\
ok="0" \n
\
fi \n
\
done < /usr/share/nginx/html/webserver-configs/nginx.conf'
>>
/etc/nginx/grav_conf.sh
RUN
/etc/nginx/grav_conf.sh
&&
sed
-i
\
-e
's|root html|root /usr/share/nginx/html|'
\
-e
's|127.0.0.1:9000;|unix:/var/run/php7.4-fpm.sock;|'
\
-e
's|/home/USER/www/html|/usr/share/nginx/html|ig'
\
/etc/nginx/sites-available/default
#Setup Php service
RUN
mkdir
-p
/etc/service/php-fpm
&&
touch
/etc/service/php-fpm/run
&&
chmod
+x /etc/service/php-fpm/run
&&
echo
'#!/bin/bash \n
\
exec /usr/sbin/php-fpm7.4 -F'
>>
/etc/service/php-fpm/run
#Setup Nginx service
RUN
mkdir
-p
/etc/service/nginx
&&
touch
/etc/service/nginx/run
&&
chmod
+x /etc/service/nginx/run
&&
echo
'#!/bin/bash \n
\
exec /usr/sbin/nginx -g "daemon off;"'
>>
/etc/service/nginx/run
RUN
mkdir
/init
&&
cd
/usr/share/nginx/html/user/
&&
cp
-R
.
/init/
RUN
mkdir
-p
/etc/service/mrun
ADD
run /etc/service/mrun/run
#Expose configuration and content volumes
VOLUME
/usr/share/nginx/html/user
#Public ports
EXPOSE
22 80
run
0 → 100755
View file @
530cba67
#!/bin/bash
mkdir
-p
/run/php
if
[
!
-f
/usr/share/nginx/html/user/initialized
]
then
touch
/usr/share/nginx/html/user/initialized
cd
/init
cp
-R
.
/usr/share/nginx/html/user/
chown
-R
www-data:www-data /usr/share/nginx/html
fi
if
[
!
-h
/usr/share/nginx/html/cache
]
then
echo
"Creating cache"
cd
/usr/share/nginx/html
rm
-rf
cache
mkdir
-p
./user/cache
ln
-s
./user/cache cache
chmod
777
-R
./user/cache
chmod
777
-R
cache
else
chmod
777
-R
/usr/share/nginx/html/cache
rm
-rf
/usr/share/nginx/html/cache
ln
-s
/usr/share/nginx/html/user/cache /usr/share/nginx/html/cache
chmod
777
-R
/usr/share/nginx/html/cache
fi
while
true
do
sleep
60
done
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