Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jleonardolemos committed May 4, 2022
0 parents commit df25273
Show file tree
Hide file tree
Showing 6 changed files with 731 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
todo-php-image.txt
43 changes: 43 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
FROM php:8.1.5-fpm-alpine3.15
# Informações
LABEL maintainer="[email protected]"
LABEL company="Convenia"

# Host user id and group id,.
# override this line to run whith a non 1000 user
ARG UID=1000
ARG GID=1000

# Instalação do php ext installer (https://github.com/mlocati/docker-php-extension-installer)
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
# Instalação de pacotes
RUN IPE_GD_WITHOUTAVIF=1 install-php-extensions bcmath bz2 calendar exif gd gettext gmp opcache pcntl \
pdo_mysql sockets xsl zip \
igbinary-stable \
redis-stable \
mongodb-stable \
imagick-stable

RUN apk add --no-cache --update supervisor=~4.2 nginx=~1.20 nginx-mod-http-headers-more openssh-client git

# Instalação do composer
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
# Cria usuário e grupo app
RUN addgroup -S -g $GID app && adduser -u $UID -G app -D app

# Copy configuration files
COPY ./docker/php-fpm.d/www.conf /usr/local/etc/php-fpm.d/www.conf
COPY ./docker/supervisor/supervisord.conf /etc/supervisord.conf
COPY ./docker/nginx/default.conf /etc/nginx/http.d/default.conf

#Enable production configuration
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

ADD ./public /var/www/app/public
RUN chown -R app:app /var/www/app

WORKDIR /var/www

EXPOSE 80

CMD [ "/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf" ]
44 changes: 44 additions & 0 deletions docker/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";

more_clear_headers Server server;
add_header server convenia;

server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /var/www/app/public;
index index.html index.php;

client_max_body_size 100M;

location ~ ^/(Dockerile|docker-compose.yml)/ {
deny all;
access_log off;
log_not_found off;
}

location ~ /\.ht {
deny all;
access_log off;
log_not_found off;
}

location ~ /\.git {
deny all;
}

location / {
try_files $uri $uri/ /index.php$is_args$args;
}

location ~\.php$ {
try_files $uri /index.php =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Loading

0 comments on commit df25273

Please sign in to comment.