Skip to content
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
.idea
.vscode
lib/confs/
Expand All @@ -13,3 +14,4 @@ coverage/
src/plugins/orangehrmFunctionalTestingPlugin
.php-cs-fixer.cache
.php-cs-fixer.php
db_orange/
77 changes: 77 additions & 0 deletions apache.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
FROM php:8.3-apache-bookworm

#WORKDIR /app

ENV OHRM_VERSION 5.7
ENV OHRM_MD5 5bd924a546e29e06c34eec73b014d139

RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

RUN set -ex; \
savedAptMark="$(apt-mark showmanual)"; \
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libzip-dev \
libldap2-dev \
libicu-dev \
unzip \
; \
# cd .. && rm -r html; \
# curl -fSL -o orangehrm.zip "https://sourceforge.net/projects/orangehrm/files/stable/${OHRM_VERSION}/orangehrm-${OHRM_VERSION}.zip"; \
# echo "${OHRM_MD5} orangehrm.zip" | md5sum -c -; \
# unzip -q orangehrm.zip "orangehrm-${OHRM_VERSION}/*"; \
# mv orangehrm-$OHRM_VERSION html; \
# rm -rf orangehrm.zip; \
# chown www-data:www-data html; \
# chown -R www-data:www-data html/src/cache html/src/log html/src/config; \
# chmod -R 775 html/src/cache html/src/log html/src/config; \
# \
docker-php-ext-configure gd --with-freetype --with-jpeg; \
docker-php-ext-configure ldap \
--with-libdir=lib/$(uname -m)-linux-gnu/ \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
intl \
pdo_mysql \
zip \
ldap \
; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/cache/apt/archives; \
rm -rf /var/lib/apt/lists/*

RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
\
if command -v a2enmod; then \
a2enmod rewrite; \
fi;


RUN chown -R www-data:www-data /var/www/html && \
chmod -R 775 /var/www/html

# VOLUME ["/var/www/html"]
54 changes: 54 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
services:

apache:
build:
context: .
dockerfile: apache.dockerfile
env_file: .env
ports:
- 8099:80
- 4049:443
volumes:
- ./:/var/www/html
environment:
ORANGEHRM_DATABASE_HOST: '${DATABASE_HOST}'
ORANGEHRM_DATABASE_USER: '${DATABASE_USER}'
ORANGEHRM_DATABASE_PASSWORD: '${DATABASE_PASSWORD}'
ORANGEHRM_DATABASE_NAME: '${DATABASE_NAME}'
PUID: 998
PGID: 100
depends_on:
- mariadb
links:
- mariadb:mariadb

mariadb:
image: mariadb:10.2
#restart: unless-stopped
env_file: .env
ports:
- 3306:3306
volumes:
- ./db_orange:/var/lib/mysql
environment:
MYSQL_DATABASE: '${DATABASE_NAME}'
MYSQL_ROOT_USER: '${DATABASE_USER}'
MYSQL_PASSWORD: '${DATABASE_PASSWORD}'
MYSQL_ROOT_PASSWORD: '${DATABASE_PASSWORD}'

phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
- mariadb
ports:
- "8084:80"
env_file: .env
environment:
PMA_HOST: mariadb
#PMA_USER: '${DATABASE_USER}'
#PMA_PASSWORD: '${DATABASE_PASSWORD}'
#MYSQL_ROOT_USER: root
MYSQL_ROOT_PASSWORD: '${DATABASE_PASSWORD}'

volumes:
db_data:
1 change: 1 addition & 0 deletions installer/client/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
endOfLine: 'auto'
};
23 changes: 23 additions & 0 deletions readme_dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Instalar dependencias do orangeHRM localmente:

./src folder:
composer install --no-suggest
(If needed) -> composer update

installer/client folder:
yarn install
yarn build / yarn dev

src/client folder:
yarn install
yarn build / yarn dev

Se der erros de prettier (formatação e eslint), executar comando:
yarn eslint --fix src/

Nos 3 ficheiros .prettier adicionar a linha:
endOfLine: 'auto'

Docker:

docker-compose run -d --build
1 change: 1 addition & 0 deletions src/client/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
endOfLine: 'auto'
};
1 change: 1 addition & 0 deletions src/test/functional/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ module.exports = {
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
endOfLine: 'auto'
};