Skip to content

Commit 946b9b7

Browse files
authored
Merge pull request #6 from jobcloud/feat/FIAP-197/fix-deprecations
feat(FIAP-197): fix deprecations
2 parents 3182975 + cd8fbe4 commit 946b9b7

43 files changed

Lines changed: 376 additions & 295 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
"email": "peter.pl7@gmail.com"
1515
}
1616
],
17+
"repositories": [
18+
{"type": "vcs", "no-api": true, "url": "git@github.com:jobcloud/zendpdf.git"}
19+
],
1720
"require": {
18-
"zendframework/zendpdf": "~2.0.0"
21+
"ext-mbstring": "*",
22+
"jobcloud/zendpdf": "^2.0.3"
1923
},
2024
"require-dev": {
2125
"imagine/imagine": ">=0.2.0,<0.6.0",
22-
"phpunit/phpunit": "^9.6.7"
26+
"phpunit/phpunit": "^8.5.33"
2327
},
28+
"prefer-stable": true,
29+
"minimum-stability": "dev",
2430
"suggest": {
2531
"imagine/imagine": "If you want to use image generating (required version: >=v0.2.6)"
2632
},

docker/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
COMPOSE_PROJECT_NAME=jobcloud-phppdf
2+
XDEBUG_REMOTE_HOST=localhost
3+
#XDEBUG_REMOTE_HOST=docker.for.mac.localhost

docker/Dockerfile

Lines changed: 0 additions & 47 deletions
This file was deleted.

docker/docker-compose.dev.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: '3.9'
2+
services:
3+
php:
4+
container_name: jobcloud-phppdf-php
5+
hostname: jobcloud-phppdf-php
6+
build:
7+
dockerfile: php/Dockerfile
8+
context: ./
9+
args:
10+
USER_ID: ${USER_ID}
11+
ports:
12+
- '8080:80'
13+
tty: true
14+
volumes:
15+
- ../:/var/www/html
16+
- ~/.bash_aliases:/home/www-data/.bash_aliases:rw
17+
- ~/.bash_history:/home/www-data/.bash_history:rw
18+
secrets:
19+
- ssh_host_key
20+
environment:
21+
XDEBUG_CONFIG: remote_host=${XDEBUG_REMOTE_HOST}
22+
PHP_IDE_CONFIG: serverName=php
23+
secrets:
24+
ssh_host_key:
25+
file: ~/.ssh/id_rsa

docker/docker-compose.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

docker/php/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM php:8.1-alpine3.18
2+
3+
ARG USER_ID
4+
5+
# PHP: Copy configuration files & remove dist files
6+
RUN mkdir /phpIni
7+
COPY php/files/bin/ /usr/local/bin/
8+
9+
# SYS: Install required packages
10+
RUN apk --no-cache upgrade && \
11+
apk --no-cache add bash git sudo openssh autoconf gcc g++ make gettext sudo shadow
12+
13+
RUN if [ -n "$USER_ID" ] && [ "$USER_ID" -lt 60001 ]; then \
14+
usermod -u ${USER_ID} -o www-data; \
15+
fi
16+
17+
# USER: set /bin/bash and allow www-data to become root
18+
RUN usermod -s /bin/bash www-data && \
19+
echo 'www-data ALL=(ALL) NOPASSWD: ALL' > '/etc/sudoers.d/www-data'
20+
21+
# USER: copy home
22+
COPY --chown=www-data:www-data php/files/user-home /home/www-data
23+
24+
# USER: add ssh key and fix permission of the ssh directory
25+
RUN ln -s /run/secrets/ssh_host_key /home/www-data/.ssh/id_rsa && \
26+
chmod 700 /home/www-data/.ssh && \
27+
chmod 400 /home/www-data/.ssh/config
28+
29+
# PHP: Install php extensions
30+
RUN pecl channel-update pecl.php.net
31+
32+
# COMPOSER: install binary
33+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
34+
35+
USER www-data
36+
37+
WORKDIR /var/www/html
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
if [ $# -eq 0 ]
4+
then
5+
echo "Please pass a php module name"
6+
exit
7+
fi
8+
9+
for phpmod in "$@"
10+
do
11+
rm -f /usr/local/etc/php/conf.d/*$phpmod*.ini
12+
done
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
if [[ ${#} -eq 0 ]] ; then
4+
echo -e "\\nPHP module name required!\\n"
5+
exit 1
6+
fi
7+
8+
for phpmod in "${@}" ; do
9+
10+
files=($(find /phpIni -type f -iname "*${phpmod}*.ini" -exec ls -1 '{}' +))
11+
12+
for i in "${files[@]}" ; do
13+
ln -s "${i}" /usr/local/etc/php/conf.d
14+
done
15+
16+
if [[ ${#files[@]} -eq 0 ]] ; then
17+
docker-php-ext-enable "${phpmod}"
18+
fi
19+
20+
done

docker/php/files/user-home/.bashrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
alias cls='printf "\033c"'
2+
3+
export PS1='\[\e[1;32m\]\h\[\e[0m\] \[\e[1;37m\]\w\[\e[0m\] \[\e[1;32m\]\u\[\e[0m\] \[\e[1;37m\]\$\[\e[0m\] '
4+
5+
if [ -f ~/.bash_aliases ]; then
6+
. ~/.bash_aliases
7+
fi
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Host *
2+
StrictHostKeyChecking no
3+
UserKnownHostsFile /dev/null
4+
IdentityFile /run/secrets/ssh_host_key

0 commit comments

Comments
 (0)