Skip to content

Commit

Permalink
add test script inside the image
Browse files Browse the repository at this point in the history
  • Loading branch information
jleonardolemos committed May 27, 2022
1 parent 73a3892 commit af109b2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ RUN addgroup -S -g $GID app && adduser -u $UID -G app -D app
COPY ./docker/php-fpm.d/www.conf /usr/local/etc/php-fpm.d/www.conf
COPY ./docker/supervisor/supervisord.conf /etc/supervisord.conf
COPY ./docker/nginx/default.conf /etc/nginx/http.d/default.conf
# For Automated Tests on Docker Hub
COPY ./docker/nginx/default.conf /etc/nginx/http.d/default.conf
COPY ./run_tests.sh /run_tests.sh

#Enable production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

ADD ./public /var/www/app/public
RUN chown -R app:app /var/www/app
RUN chown -R app:app /var/www/app && chmod +x /run_tests.sh

WORKDIR /var/www/app

Expand Down
5 changes: 1 addition & 4 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
services:
sut:
user: app:app
build: .
volumes:
- ./run_tests.sh:/var/www/app/run_tests.sh
command: cd /var/www/app && run_tests.sh
command: /run_tests.sh
4 changes: 3 additions & 1 deletion run_tests.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/sh
supervisord &
sleep 5
cd /var/www/app
rm -rf public
rm supervisord.pid
rm run.sh
composer create-project laravel/laravel .
curl --fail 127.0.0.1

0 comments on commit af109b2

Please sign in to comment.