-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdockerfile-tools-template
90 lines (83 loc) · 2.96 KB
/
dockerfile-tools-template
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
FROM markkimsal/php-platform:<?php echo $release;?>-nginx-fpm
# CURL GIT UNZIP
RUN set -ex && \
{ \
apt-get update ; \
apt-get install -y --no-install-recommends curl unzip git-core jq; \
}
# COMPOSER
RUN set -ex && \
{ \
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"; \
php -r 'copy("https://getcomposer.org/installer", "composer-setup.php");'; \
ACTUAL_CHECKSUM="$(php -r 'echo hash_file("sha384", "composer-setup.php");')"; \
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; \
then \
>&2 echo 'ERROR: Invalid installer checksum'; \
rm composer-setup.php; \
exit 1; \
fi; \
php composer-setup.php --quiet; \
RESULT=$? \
mv composer.phar /usr/local/bin/composer; \
chmod a+x /usr/local/bin/composer; \
php composer-setup.php -1 --quiet; \
RESULT=$? \
mv composer.phar /usr/local/bin/composer1.10; \
chmod a+x /usr/local/bin/composer1.10; \
rm composer-setup.php; \
}
# GIT
RUN set -ex && \
{ \
apt-get install -y --no-install-recommends git-core; \
}
<?php if ($majorVersion !== '8.1'): ?>
# NODEJS
RUN set -ex && \
{ \
cd ~; \
curl -sL https://deb.nodesource.com/setup_15.x -o nodesource_setup.sh; \
bash ./nodesource_setup.sh; \
apt update && apt-get install -y --no-install-recommends nodejs; \
}
<?php endif; ?>
<?php if ($majorVersion !== '8.1'): ?>
# YARN
RUN set -ex && \
{ \
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -; \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list; \
apt update && apt-get install -y --no-install-recommends yarn; \
}
<?php endif; ?>
# DEPLOYER
<?php if (version_compare($majorVersion, '8.1', '>=')): ?>
RUN set -ex && \
{ \
curl -LO https://deployer.org/deployer.phar; \
mv deployer.phar /usr/local/bin/deployer6; \
curl -LO https://github.com/deployphp/deployer/releases/download/v7.3.3/deployer.phar; \
cp deployer.phar /usr/local/bin/deployer7; \
mv deployer.phar /usr/local/bin/deployer; \
chmod +x /usr/local/bin/deployer; \
chmod +x /usr/local/bin/deployer6; \
chmod +x /usr/local/bin/deployer7; \
apt-get install -y --no-install-recommends openssh-client; \
}
<?php else: ?>
RUN set -ex && \
{ \
curl -LO https://deployer.org/deployer.phar; \
mv deployer.phar /usr/local/bin/deployer; \
chmod +x /usr/local/bin/deployer; \
composer global require deployer/recipes --dev; \
curl -L https://raw.githubusercontent.com/kohkimakimoto/altax/master/installer.sh | bash -s system; \
apt-get install -y --no-install-recommends openssh-client; \
}
<?php endif; ?>
RUN rm -rf /var/lib/apt/lists/*;
RUN chown www-data /var/www;
WORKDIR /app
ENTRYPOINT []
CMD ["/bin/bash"]