Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Composer installation in dockerfile fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Paramtamtam committed Jan 24, 2019
1 parent 47b3723 commit 93c8031
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 29 deletions.
26 changes: 17 additions & 9 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
root = true

[*]
charset=utf-8
end_of_line=lf
insert_final_newline=false
indent_style=space
indent_size=4

[{*.yml,*.yaml}]
indent_style=space
indent_size=2
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{md,json}]
trim_trailing_whitespace = false

[*.{yml,yaml,sh,conf}]
indent_size = 2

[Makefile]
indent_style = tab
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## v2.3.1

### Fixed

- Composer installation in dockerfile

## v2.3.0

### Changed
Expand Down Expand Up @@ -33,3 +43,6 @@
- `WindowsSpyBlocker` hosts file URI [#10]

[#10]: https://github.com/tarampampam/mikrotik-hosts-parser/issues/10

[keepachangelog]:https://keepachangelog.com/en/1.0.0/
[semver]:https://semver.org/spec/v2.0.0.html
36 changes: 16 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
FROM composer:1.8.0 AS composer

FROM phppm/nginx:latest
LABEL Description="Mikrotik hosts parser application container"

ENV COMPOSER_ALLOW_SUPERUSER="1" \
COMPOSER_HOME="/tmp/composer" \
PS1='\[\033[1;32m\]🐳 \[\033[1;36m\][\u@\h] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]# \[\033[0m\]'

COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY . /app/src

WORKDIR /app/src

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

VOLUME ["/app/src"]

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

0 comments on commit 93c8031

Please sign in to comment.