Skip to content

Commit

Permalink
(infra) Remove composer container and let laravel container install d…
Browse files Browse the repository at this point in the history
…ependencies
  • Loading branch information
alchalade committed Jan 25, 2024
1 parent 9e2e0e9 commit dbfe2f0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
9 changes: 6 additions & 3 deletions Docker/DockerfileLaravelDev
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ RUN apt-get update && \
git \
zsh


# install ohmyzsh
RUN chsh -s $(which zsh)
RUN sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# add php artisan alias
RUN echo 'alias "cmd=php artisan"' >> ~/.zshrc


# remove apt lists
RUN rm -rf /var/lib/apt/lists/*

Expand All @@ -41,6 +39,11 @@ RUN touch /usr/local/etc/php/conf.d/xdebug.ini; \
echo xdebug.remote_log=/tmp/php5-xdebug.log >> /usr/local/etc/php/conf.d/xdebug.ini;log=/tmp/php5-xdebug.log >> /usr/local/etc/php/conf.d/xdebug.ini;

COPY configuration/webserver/sites-enabled/000-default.conf /etc/apache2/sites-enabled

COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

RUN a2enmod ssl
RUN a2enmod rewrite
RUN service apache2 restart
RUN service apache2 restart
13 changes: 13 additions & 0 deletions Docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh
cd /var/www/html/mpmanager
php composer.phar install
echo "Executing command: $@"

# the main image's CMD arguments are somehow not passed to this script
# so we need to check if there are any arguments and if not, execute apache2-foreground which is the default CMD of the main image
if [ -z "$@" ]; then
echo "No arguments supplied, executing apache2-foreground..."
exec apache2-foreground
else
exec "$@"
fi
8 changes: 0 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ services:
- maria:db
- redis:redis

composer:
container_name: mpmanager_composer
image: composer:2.6.5
restart: "no"
command: install --ignore-platform-reqs
volumes:
- ./Website/htdocs/mpmanager:/app

'redis':
image: redis:5
volumes:
Expand Down

0 comments on commit dbfe2f0

Please sign in to comment.