Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(infra) Remove composer container and let laravel container install d… #27

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading