Created
February 18, 2024 18:19
-
-
Save wesllycode/7743d28aa8a90beccec08ffd1811d82e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
FROM php:8.0-fpm | |
# Install system dependencies for build tools and extensions | |
# Install system dependencies | |
RUN apt-get update \ | |
&& apt-get -y --no-install-recommends install php-xdebug \ | |
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | |
RUN apt-get update && apt-get install -y \ | |
git \ | |
curl \ | |
libpng-dev \ | |
libonig-dev \ | |
libxml2-dev \ | |
varnish \ | |
zip \ | |
nginx \ | |
bash \ | |
unzip | |
RUN useradd nginx | |
RUN mkdir -p /run/nginx | |
# Clear cache | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | |
RUN pecl install -o -f xdebug-3.1.5 | |
RUN docker-php-ext-enable xdebug | |
# Install PHP extensions | |
# RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd sockets | |
# Install Composer globally | |
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | |
&& php composer-setup.php \ | |
&& php -r "unlink('composer-setup.php');" \ | |
&& mv composer.phar /usr/local/bin/composer | |
# Instalando extensões do PHP | |
RUN pecl install redis && docker-php-ext-enable redis \ | |
&& docker-php-ext-install bcmath ctype pdo pdo_mysql xml tokenizer mbstring intl sockets | |
# Copy certificates for SSL testing | |
COPY storage/docker/certificate /local/certificates | |
# Copy configuration files | |
COPY storage/docker/php.ini /usr/local/etc/php/php.ini | |
COPY storage/docker/nginx-local.conf /etc/nginx/conf.d/default.conf | |
COPY storage/docker/geral-nginx.conf /etc/nginx/nginx.conf | |
COPY storage/docker/varnish.prerelease.vcl /etc/varnish/default.vcl | |
COPY storage/docker/fpm.conf /usr/local/etc/php-fpm.d/www.conf | |
RUN pecl config-set php_ini "${PHP_INI_DIR}/php.ini" | |
# install X-debug | |
COPY storage/docker/90-xdebug.ini "${PHP_INI_DIR}/conf.d" | |
# Portas que serão expostas | |
EXPOSE 443 | |
EXPOSE 80 | |
EXPOSE 8080 | |
EXPOSE 8081 | |
# Para alterar o caminho da versão LTS do node acessar essa página | |
# https://github.com/nodesource/distributions#debmanual | |
#RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - | |
#RUN apt-get update && apt-get install -y nodejs | |
# Instalar a versão mais recente do NPM | |
#RUN curl -qL https://www.npmjs.com/install.sh | sh | |
#RUN apt-get update | |
# Entrypoint script for starting services | |
COPY storage/docker/dev-up.sh /code/storage/docker/dev-up.sh | |
# Prepare working directory | |
WORKDIR /code | |
RUN chmod +x /code/storage/docker/dev-up.sh | |
RUN chown -Rf www-data: /code && chmod -Rf 755 /code | |
#ENTRYPOINT sh storage/docker/dev-up.sh | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment