Skip to content

Commit 93c8031

Browse files
author
Paramtamtam
committed
Composer installation in dockerfile fixed
1 parent 47b3723 commit 93c8031

File tree

3 files changed

+46
-29
lines changed

3 files changed

+46
-29
lines changed

.editorconfig

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1+
root = true
2+
13
[*]
2-
charset=utf-8
3-
end_of_line=lf
4-
insert_final_newline=false
5-
indent_style=space
6-
indent_size=4
7-
8-
[{*.yml,*.yaml}]
9-
indent_style=space
10-
indent_size=2
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.{md,json}]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml,sh,conf}]
15+
indent_size = 2
16+
17+
[Makefile]
18+
indent_style = tab

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
6+
7+
## v2.3.1
8+
9+
### Fixed
10+
11+
- Composer installation in dockerfile
12+
313
## v2.3.0
414

515
### Changed
@@ -33,3 +43,6 @@
3343
- `WindowsSpyBlocker` hosts file URI [#10]
3444

3545
[#10]: https://github.com/tarampampam/mikrotik-hosts-parser/issues/10
46+
47+
[keepachangelog]:https://keepachangelog.com/en/1.0.0/
48+
[semver]:https://semver.org/spec/v2.0.0.html

Dockerfile

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
1+
FROM composer:1.8.0 AS composer
2+
13
FROM phppm/nginx:latest
24
LABEL Description="Mikrotik hosts parser application container"
35

6+
ENV COMPOSER_ALLOW_SUPERUSER="1" \
7+
COMPOSER_HOME="/tmp/composer" \
8+
PS1='\[\033[1;32m\]🐳 \[\033[1;36m\][\u@\h] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]'
9+
10+
COPY --from=composer /usr/bin/composer /usr/bin/composer
411
COPY . /app/src
512

613
WORKDIR /app/src
714

8-
RUN \
9-
echo -e "\n\
10-
alias ls='ls --color=auto';\n\
11-
export PS1='\[\e[1;31m\]\$(echo \"[\"\${?/0/}\"]\" | sed \"s/\\[\\]//\")\$(echo \"\[\e[32m\][hosts-parser] \
12-
\[\e[37m\]\")\u@\h: \[\e[00m\]\w \\$ ';\n\n" >> /root/.bashrc \
13-
&& php --version \
14-
&& export COMPOSER_HOME="/usr/local/share" \
15-
&& export COMPOSER_ALLOW_SUPERUSER="1" \
16-
&& export PATH="$COMPOSER_HOME:$COMPOSER_HOME/vendor/bin:$PATH" \
17-
&& php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');" \
18-
&& php -r "if(hash_file('SHA384','/tmp/composer-setup.php')==='544e09ee996cdf60ece3804abc52599c22b1f40f4323403c'.\
19-
'44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061'){echo 'Verified';}else{unlink('/tmp/composer-setup.php');}" \
20-
&& php /tmp/composer-setup.php --filename=composer --install-dir=$COMPOSER_HOME \
21-
&& rm -Rf /tmp/* \
22-
&& $COMPOSER_HOME/composer --no-interaction global require 'hirak/prestissimo' \
23-
&& composer install --no-interaction --no-suggest --no-dev \
24-
&& composer clear-cache \
25-
&& composer dump-autoload \
26-
&& php ./artisan cache:clear
15+
RUN set -xe \
16+
&& php --version \
17+
&& rm -Rf /tmp/* \
18+
&& composer global require 'hirak/prestissimo' --no-interaction --no-suggest --prefer-dist \
19+
&& composer install --no-dev --no-interaction --no-ansi --no-suggest --prefer-dist \
20+
&& composer clear-cache \
21+
&& composer dump-autoload \
22+
&& php ./artisan cache:clear
2723

2824
VOLUME ["/app/src"]
2925

30-
CMD ["--bootstrap=laravel", "--app-env=prod", "--workers=8", "--static-directory=public/"]
26+
CMD ["--bootstrap=laravel", "--app-env=prod", "--workers=4", "--static-directory=public/"]

0 commit comments

Comments
 (0)