8000 feat: atualiza para o php 7.4+ · zino-coder/docker-php8@d1f6a7d · GitHub
[go: up one dir, main page]

Skip to content

Commit d1f6a7d

Browse files
Vagner CardosoVagner Cardoso
Vagner Cardoso
authored and
Vagner Cardoso
committed
feat: atualiza para o php 7.4+
1 parent 3ddb1f9 commit d1f6a7d

File tree

11 files changed

+68
-87
lines changed

11 files changed

+68
-87
lines changed

docker/Dockerfile renamed to .docker/Dockerfile

+8-18
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
FROM php:7.3-apache
1+
FROM php:7.4-apache
22

33
# Atualiza e instala dependências
44
RUN apt-get update \
5-
&& apt-get upgrade -y \
65
&& apt-get autoremove -y \
76
&& apt-get install -yq \
87
zlib1g-dev \
@@ -18,21 +17,18 @@ RUN apt-get update \
1817
libnotify-bin \
1918
libwebp-dev \
2019
libxpm-dev \
20+
libonig-dev \
2121
unixodbc \
2222
unixodbc-dev \
2323
freetds-dev \
2424
freetds-bin \
2525
tdsodbc \
2626
curl \
27-
git \
2827
vim \
29-
sudo \
3028
gnupg \
31-
unzip \
32-
&& rm -rf /var/lib/apt/lists/*
29+
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
3330

3431
# Instala dependencia do php
35-
RUN docker-php-ext-configure gd --with-gd --with-webp-dir --with-jpeg-dir --with-png-dir --with-zlib-dir --with-xpm-dir --with-freetype-dir
3632
RUN docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu
3733
RUN docker-php-ext-configure soap --enable-soap
3834
RUN docker-php-ext-install \
@@ -56,11 +52,7 @@ RUN docker-php-ext-install \
5652
soap
5753

5854
# Instala composer
59-
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
60-
&& php -r "copy('https://composer.github.io/installer.sig', 'installer.sig');" \
61-
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === trim(file_get_contents('installer.sig'))) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); unlink('installer.sig');} echo PHP_EOL;" \
62-
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
63-
&& php -r "unlink('composer-setup.php'); unlink('installer.sig');"
55+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
6456

6557
# Instala xdebug
6658
RUN pecl -v install xdebug-beta
@@ -70,17 +62,15 @@ RUN docker-php-ext-enable xdebug
7062
# RUN pecl -v install rar
7163
# RUN docker-php-ext-enable rar
7264

73-
# Habilita modulos do apache
74-
RUN a2enmod rewrite
75-
RUN a2enmod ssl
76-
7765
# Cria certificado SSL
7866
RUN openssl req -new -x509 -days 365 -nodes \
7967
-out /etc/ssl/certs/ssl-cert-snakeoil.pem \
8068
-keyout /etc/ssl/private/ssl-cert-snakeoil.key \
81-
-subj "/C=BR/ST=Paraná/L=Umuarama/O=VCWeb Networks/CN=*.localhost"
69+
-subj "/CN=*.localhost"
8270

83-
# Habilita o certificado SSL
71+
# Habilita modulos e site
72+
RUN a2enmod rewrite
73+
RUN a2enmod ssl
8474
RUN a2ensite default-ssl
8575

8676
# Permissão de usuários
File renamed without changes.

.docker/apache/vhosts/localhost.conf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<VirtualHost *:80>
2+
ServerName localhost
3+
ServerAlias www.localhost
4+
ServerAdmin webmaster@localhost
5+
6+
DocumentRoot ${DOCUMENT_ROOT}
7+
8+
ErrorLog ${APACHE_LOG_DIR}/error.log
9+
CustomLog ${APACHE_LOG_DIR}/access.log combined
10+
</VirtualHost>
File renamed without changes.

.docker/php/php.ini

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
allow_url_fopen = On
2+
allow_url_include = Off
3+
asp_tags = Off
4+
display_errors = On
5+
display_startup_errors = On
6+
error_reporting = E_ALL
7+
enable_dl = Off
8+
file_uploads = On
9+
max_execution_time = 300
10+
max_input_time = 60
< F438 div aria-hidden="true" class="position-absolute top-0 d-flex user-select-none DiffLineTableCellParts-module__comment-indicator--eI0hb">
11+
max_input_vars = 100000
12+
memory_limit = 1024M
13+
session.gc_maxlifetime = 1440
14+
upload_max_filesize = 250M
15+
post_max_size = 500M
16+
max_file_uploads = 50
17+
date.timezone = America/Sao_Paulo

.gitignore

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
/**/.idea/
2-
/**/docker/apache/logs/*
3-
!/**/docker/apache/logs/.gitkeep
4-
!/**/docker/apache/logs/apache2/.gitkeep
5-
/**/docker/mysql/*
6-
!/**/docker/mysql/config
7-
!/**/docker/mysql/database/.gitkeep
8-
/**/docker/postgres/*
9-
!/**/docker/postgres/.gitkeep
2+
/**/.docker/apache/logs/*
3+
!/**/.docker/apache/logs/.gitkeep
4+
/**/.docker/mysql/data/
5+
/**/.docker/postgres/data/*

docker-compose.yml

+27-31
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,36 @@ version: '3'
22

33
services:
44
web:
5-
build: ./docker
5+
build: ./.docker
66
working_dir: /var/www
7-
restart: always
87
networks:
9-
- mysql-network
10-
# - pgsql-network
8+
- mysql
9+
- pgsql
1110
depends_on:
1211
- mysql
13-
# - pgsql
12+
- pgsql
1413
ports:
1514
- '80:80'
1615
- '443:443'
1716
volumes:
18-
- '.:/var/www'
19-
- './docker/apache/000-default.conf:/etc/apache2/sites-available/000-default.conf'
20-
- './docker/apache/default-ssl.conf:/etc/apache2/sites-available/default-ssl.conf'
17+
- .:/var/www
18+
- ./.docker/php/php.ini:/usr/local/etc/php/conf.d/99-php.ini
19+
- ./.docker/apache/vhosts/localhost.conf:/etc/apache2/sites-available/000-default.conf
20+
- ./.docker/apache/vhosts/localhost-ssl.conf:/etc/apache2/sites-available/default-ssl.conf
2121
environment:
2222
- COMPOSER_ALLOW_SUPERUSER=1
2323
- DOCUMENT_ROOT=/var/www/public_html
24-
- APACHE_LOG_DIR=/var/www/docker/apache/logs
24+
- APACHE_LOG_DIR=/var/www/.docker/apache/logs
2525

2626
mysql:
2727
image: mysql:5.7
28-
restart: always
2928
networks:
30-
- mysql-network
29+
- mysql
3130
ports:
3231
- '3306:3306'
3332
volumes:
34-
- './docker/mysql/config:/etc/mysql/conf.d'
35-
- './docker/mysql/database:/var/lib/mysql'
33+
- './.docker/mysql/data:/var/lib/mysql'
34+
- './.docker/mysql/settings:/etc/mysql/conf.d'
3635
environment:
3736
- MYSQL_PASSWORD=root
3837
- MYSQL_ROOT_PASSWORD=root
@@ -41,7 +40,7 @@ services:
4140
# phpmyadmin:
4241
# image: phpmyadmin/phpmyadmin
4342
# networks:
44-
# - mysql-network
43+
# - mysql
4544
# depends_on:
4645
# - mysql
4746
# environment:
@@ -50,22 +49,19 @@ services:
5049
# ports:
5150
# - '8080:80'
5251

53-
# pgsql:
54-
# image: postgres
55-
# restart: always
56-
# networks:
57-
# - pgsql-network
58-
# ports:
59-
# - '5432:5432'
60-
# volumes:
61-
# - './docker/postgres:/var/lib/postgresql/data'
62-
# environment:
63-
# - POSTGRES_USER=root
64-
# - POSTGRES_PASSWORD=root
65-
# - POSTGRES_DB=development
52+
pgsql:
53+
image: postgres:alpine
54+
networks:
55+
- pgsql
56+
ports:
57+
- '5432:5432'
58+
volumes:
59+
- './.docker/postgres/data:/var/lib/postgresql/data'
60+
environment:
61+
- POSTGRES_USER=root
62+
- POSTGRES_PASSWORD=root
63+
- POSTGRES_DB=development
6664

6765
networks:
68-
mysql-network:
69-
driver: bridge
70-
# pgsql-network:
71-
# driver: bridge
66+
mysql:
67+
pgsql:

docker/apache/000-default.conf

-28
This file was deleted.

docker/postgres/.gitkeep

Whitespace-only changes.

readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Docker PHP 7.3 + Apache2 + Mysql + PostgreSQL
1+
# Docker PHP 7.4 + Apache2 + Mysql + PostgreSQL
22

33
Caso não tenha é preciso instalar o docker e docker-compose.
44

@@ -16,7 +16,7 @@ docker-compose up -d
1616
## Dependências
1717

1818
- [Apache2](https://httpd.apache.org/) v2.4+
19-
- [PHP](https://php.net/) v7.3+
19+
- [PHP](https://php.net/) v7.4+
2020

2121
- [PHP Modules]
2222

0 commit comments

Comments
 (0)
0