From dfcdb0823c45eec0cb0d57328cbde59100729488 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Wed, 31 Jan 2024 16:05:13 +1100 Subject: [PATCH] Fix some test issues --- .codepipeline/test_agent/Dockerfile | 9 ++++++ test_agent-compose.yml | 50 ----------------------------- 2 files changed, 9 insertions(+), 50 deletions(-) diff --git a/.codepipeline/test_agent/Dockerfile b/.codepipeline/test_agent/Dockerfile index bf87e37a..17ebd573 100644 --- a/.codepipeline/test_agent/Dockerfile +++ b/.codepipeline/test_agent/Dockerfile @@ -60,4 +60,13 @@ COPY /.codepipeline/local-dev/configs/supervisord/supervisord.conf /etc/supervis RUN mkdir /run/php RUN chmod -R 777 start.sh + +# Healthcheck to ensure nginx is running and cmfive is installed +HEALTHCHECK --interval=10s --timeout=10s --start-period=5s --retries=15 \ + CMD curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 | grep -q -E "^[1-3][0-9]{2}$" && \ + test -f ~/.cmfive-installed + +RUN cd /etc/nginx && \ + openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx.key -out nginx.crt -subj "/C=AU/ST=NSW/L=Bega/O=2pi/CN=localhost" + CMD ["/bootstrap/start.sh"] diff --git a/test_agent-compose.yml b/test_agent-compose.yml index 30209c62..dcd80397 100644 --- a/test_agent-compose.yml +++ b/test_agent-compose.yml @@ -3,57 +3,7 @@ version: '3' services: - mysqldb: - image: mysql:8 - container_name: mysql-8 - hostname: mysql-8 - # command: --sql-mode="" - ports: - - "3306:3306" - environment: - - MYSQL_ROOT_PASSWORD=root - - TZ=Australia/Sydney - volumes: - - dbdata:/var/lib/mysql:delegated - # 'delegated' may be faster on mac or win? - networks: - - default - webapp: build: context: . dockerfile: .codepipeline/test_agent/Dockerfile - container_name: nginx-php8.1 - hostname: nginx-php8.1 - environment: - - TZ=Australia/Sydney - volumes: - - ./:/var/www/html - - ./test/Codeception/tests/boilerplate:/var/www/html/test/Codeception/tests/boilerplate - ports: - - "3000:3000" - networks: - - default - restart: unless-stopped - working_dir: /var/www/html - links: - - mysqldb - - seleniumsrv - - seleniumsrv: - image: selenium/standalone-chrome:111.0 - container_name: seleniumDrv - hostname: seleniumDrv - ports: - - "4444:4444" - environment: - - TZ=Australia/Sydney - networks: - - default - -volumes: - dbdata: - driver: local - -networks: - default: