Update icehrm docker production setup

This commit is contained in:
Thilina Pituwala
2020-05-24 02:24:55 +02:00
parent b68401efeb
commit 854e1038c6
7 changed files with 12 additions and 16 deletions

1
.gitignore vendored
View File

@@ -17,6 +17,7 @@ web/admin/dist/*.map
web/modules/dist/*.map web/modules/dist/*.map
docker/development/db_data docker/development/db_data
docker/prod/db_data docker/prod/db_data
docker/prod/app_data
docker/testing/db_data docker/testing/db_data
test/frontend/cypress/videos/* test/frontend/cypress/videos/*
test/frontend/cypress/screenshots/* test/frontend/cypress/screenshots/*

View File

@@ -53,12 +53,6 @@ USER nobody
# Add application # Add application
WORKDIR /var/www/html 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 the port nginx is reachable on
EXPOSE 8080 EXPOSE 8080

View File

@@ -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 COPY --chown=nobody ./docker/prod/config/config.php /var/www/html/app/config.php
# Expose the port nginx is reachable on # Expose the port nginx is reachable on
EXPOSE 80 EXPOSE 8070
# Let supervisord start nginx & php-fpm # Let supervisord start nginx & php-fpm
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# Configure a healthcheck to validate that everything is up&running # 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

View File

@@ -18,6 +18,9 @@ services:
context: ./ context: ./
dockerfile: Dockerfile-prod dockerfile: Dockerfile-prod
ports: ports:
- 80:80 - 8070:8070
volumes:
- ./docker/prod/app_data:/var/www/html/app/data
volumes: volumes:
db_data: db_data:
app_data:

View File

@@ -18,8 +18,6 @@ services:
ports: ports:
- 8080:8080 - 8080:8080
volumes: volumes:
- ./app:/var/www/html/app - .:/var/www/html
- ./web:/var/www/html/web
- ./core:/var/www/html/core
volumes: volumes:
db_data: db_data:

View File

@@ -4,8 +4,8 @@ ini_set('error_log', 'data/icehrm.log');
define('CLIENT_NAME', 'icehrm'); define('CLIENT_NAME', 'icehrm');
define('APP_BASE_PATH', '/var/www/html/core/'); define('APP_BASE_PATH', '/var/www/html/core/');
define('CLIENT_BASE_PATH', '/var/www/html/app/'); define('CLIENT_BASE_PATH', '/var/www/html/app/');
define('BASE_URL','http://localhost/web/'); define('BASE_URL','http://localhost:8070/web/');
define('CLIENT_BASE_URL','http://localhost/app/'); define('CLIENT_BASE_URL','http://localhost:8070/app/');
define('APP_DB', 'icehrm'); define('APP_DB', 'icehrm');
define('APP_USERNAME', 'prod'); define('APP_USERNAME', 'prod');

View File

@@ -30,8 +30,8 @@ http {
# Default server definition # Default server definition
server { server {
listen [::]:80 default_server; listen [::]:8070 default_server;
listen 80 default_server; listen 8070 default_server;
server_name _; server_name _;
sendfile off; sendfile off;