forked from psliwa/PHPPdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jobcloud/feat/FIAP-197/fix-deprecations
feat(FIAP-197): fix deprecations
- Loading branch information
Showing
43 changed files
with
376 additions
and
295 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
COMPOSE_PROJECT_NAME=jobcloud-phppdf | ||
XDEBUG_REMOTE_HOST=localhost | ||
#XDEBUG_REMOTE_HOST=docker.for.mac.localhost |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '3.9' | ||
services: | ||
php: | ||
container_name: jobcloud-phppdf-php | ||
hostname: jobcloud-phppdf-php | ||
build: | ||
dockerfile: php/Dockerfile | ||
context: ./ | ||
args: | ||
USER_ID: ${USER_ID} | ||
ports: | ||
- '8080:80' | ||
tty: true | ||
volumes: | ||
- ../:/var/www/html | ||
- ~/.bash_aliases:/home/www-data/.bash_aliases:rw | ||
- ~/.bash_history:/home/www-data/.bash_history:rw | ||
secrets: | ||
- ssh_host_key | ||
environment: | ||
XDEBUG_CONFIG: remote_host=${XDEBUG_REMOTE_HOST} | ||
PHP_IDE_CONFIG: serverName=php | ||
secrets: | ||
ssh_host_key: | ||
file: ~/.ssh/id_rsa |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM php:8.1-alpine3.18 | ||
|
||
ARG USER_ID | ||
|
||
# PHP: Copy configuration files & remove dist files | ||
RUN mkdir /phpIni | ||
COPY php/files/bin/ /usr/local/bin/ | ||
|
||
# SYS: Install required packages | ||
RUN apk --no-cache upgrade && \ | ||
apk --no-cache add bash git sudo openssh autoconf gcc g++ make gettext sudo shadow | ||
|
||
RUN if [ -n "$USER_ID" ] && [ "$USER_ID" -lt 60001 ]; then \ | ||
usermod -u ${USER_ID} -o www-data; \ | ||
fi | ||
|
||
# USER: set /bin/bash and allow www-data to become root | ||
RUN usermod -s /bin/bash www-data && \ | ||
echo 'www-data ALL=(ALL) NOPASSWD: ALL' > '/etc/sudoers.d/www-data' | ||
|
||
# USER: copy home | ||
COPY --chown=www-data:www-data php/files/user-home /home/www-data | ||
|
||
# USER: add ssh key and fix permission of the ssh directory | ||
RUN ln -s /run/secrets/ssh_host_key /home/www-data/.ssh/id_rsa && \ | ||
chmod 700 /home/www-data/.ssh && \ | ||
chmod 400 /home/www-data/.ssh/config | ||
|
||
# PHP: Install php extensions | ||
RUN pecl channel-update pecl.php.net | ||
|
||
# COMPOSER: install binary | ||
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer | ||
|
||
USER www-data | ||
|
||
WORKDIR /var/www/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -eq 0 ] | ||
then | ||
echo "Please pass a php module name" | ||
exit | ||
fi | ||
|
||
for phpmod in "$@" | ||
do | ||
rm -f /usr/local/etc/php/conf.d/*$phpmod*.ini | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
if [[ ${#} -eq 0 ]] ; then | ||
echo -e "\\nPHP module name required!\\n" | ||
exit 1 | ||
fi | ||
|
||
for phpmod in "${@}" ; do | ||
|
||
files=($(find /phpIni -type f -iname "*${phpmod}*.ini" -exec ls -1 '{}' +)) | ||
|
||
for i in "${files[@]}" ; do | ||
ln -s "${i}" /usr/local/etc/php/conf.d | ||
done | ||
|
||
if [[ ${#files[@]} -eq 0 ]] ; then | ||
docker-php-ext-enable "${phpmod}" | ||
fi | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
alias cls='printf "\033c"' | ||
|
||
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\] ' | ||
|
||
if [ -f ~/.bash_aliases ]; then | ||
. ~/.bash_aliases | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Host * | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
IdentityFile /run/secrets/ssh_host_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.