From 854e1038c60ae85f3b48d7710eb9bd98d7d2e5fe Mon Sep 17 00:00:00 2001 From: Thilina Pituwala Date: Sun, 24 May 2020 02:24:55 +0200 Subject: [PATCH] Update icehrm docker production setup --- .gitignore | 1 + Dockerfile | 6 ------ Dockerfile-prod | 4 ++-- docker-compose-prod.yaml | 5 ++++- docker-compose.yaml | 4 +--- docker/prod/config/config.php | 4 ++-- docker/prod/config/nginx.conf | 4 ++-- 7 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index dd8b03bb..3e0e9a4b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ web/admin/dist/*.map web/modules/dist/*.map docker/development/db_data docker/prod/db_data +docker/prod/app_data docker/testing/db_data test/frontend/cypress/videos/* test/frontend/cypress/screenshots/* diff --git a/Dockerfile b/Dockerfile index d229545a..526de2bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,12 +53,6 @@ USER nobody # Add application WORKDIR /var/www/html -COPY --chown=nobody ./app /var/www/html/app/ -COPY --chown=nobody ./core /var/www/html/core/ -COPY --chown=nobody ./web /var/www/html/web/ -COPY --chown=nobody ./index.php /var/www/html/index.php -COPY --chown=nobody ./docker/development/config/config.php /var/www/html/app/config.php -COPY --chown=nobody ./docker/development/config/info.php /var/www/html/app/info.php # Expose the port nginx is reachable on EXPOSE 8080 diff --git a/Dockerfile-prod b/Dockerfile-prod index 9faef60e..0092847d 100644 --- a/Dockerfile-prod +++ b/Dockerfile-prod @@ -40,10 +40,10 @@ COPY --chown=nobody ./index.php /var/www/html/index.php COPY --chown=nobody ./docker/prod/config/config.php /var/www/html/app/config.php # Expose the port nginx is reachable on -EXPOSE 80 +EXPOSE 8070 # Let supervisord start nginx & php-fpm CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] # Configure a healthcheck to validate that everything is up&running -HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8082/fpm-ping +HEALTHCHECK --timeout=10s CMD curl --silent --fail http://127.0.0.1:8071/fpm-ping diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml index 6b743208..8b6a02b9 100644 --- a/docker-compose-prod.yaml +++ b/docker-compose-prod.yaml @@ -18,6 +18,9 @@ services: context: ./ dockerfile: Dockerfile-prod ports: - - 80:80 + - 8070:8070 + volumes: + - ./docker/prod/app_data:/var/www/html/app/data volumes: db_data: + app_data: diff --git a/docker-compose.yaml b/docker-compose.yaml index 12766edd..c1edb604 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -18,8 +18,6 @@ services: ports: - 8080:8080 volumes: - - ./app:/var/www/html/app - - ./web:/var/www/html/web - - ./core:/var/www/html/core + - .:/var/www/html volumes: db_data: diff --git a/docker/prod/config/config.php b/docker/prod/config/config.php index b6c72c57..88c59ac0 100644 --- a/docker/prod/config/config.php +++ b/docker/prod/config/config.php @@ -4,8 +4,8 @@ ini_set('error_log', 'data/icehrm.log'); define('CLIENT_NAME', 'icehrm'); define('APP_BASE_PATH', '/var/www/html/core/'); define('CLIENT_BASE_PATH', '/var/www/html/app/'); -define('BASE_URL','http://localhost/web/'); -define('CLIENT_BASE_URL','http://localhost/app/'); +define('BASE_URL','http://localhost:8070/web/'); +define('CLIENT_BASE_URL','http://localhost:8070/app/'); define('APP_DB', 'icehrm'); define('APP_USERNAME', 'prod'); diff --git a/docker/prod/config/nginx.conf b/docker/prod/config/nginx.conf index 52ca3a9d..ad5e96b5 100644 --- a/docker/prod/config/nginx.conf +++ b/docker/prod/config/nginx.conf @@ -30,8 +30,8 @@ http { # Default server definition server { - listen [::]:80 default_server; - listen 80 default_server; + listen [::]:8070 default_server; + listen 8070 default_server; server_name _; sendfile off;