first commit, docker base

This commit is contained in:
Sergio Álvarez 2021-12-20 01:08:53 +01:00
commit d822e5cb19
No known key found for this signature in database
GPG Key ID: BD711A37FE7DD77E
4 changed files with 49 additions and 0 deletions

37
docker/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
# syntax=docker/dockerfile:1
FROM php:8.1-fpm
RUN apt update && apt install -y git wget
# https://github.com/mlocati/docker-php-extension-installer
RUN curl -sSLf -o /usr/local/bin/install-php-extensions \
https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
chmod +x /usr/local/bin/install-php-extensions
RUN wget https://raw.githubusercontent.com/composer/getcomposer.org/main/web/installer -O - | php -- && \
chmod +x composer.phar && \
mv composer.phar /usr/local/bin/composer
RUN wget https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar && \
chmod +x pickle.phar && \
mv pickle.phar /usr/local/bin/pickle
RUN wget https://get.symfony.com/cli/installer -O - | bash && \
mv /root/.symfony/bin/symfony /usr/local/bin/symfony
RUN install-php-extensions apcu intl opcache redis timezonedb
#RUN apt-get update && apt-get install -y \
# libfreetype6-dev \
# libjpeg62-turbo-dev \
# libpng-dev \
# && docker-php-ext-configure gd --with-freetype --with-jpeg \
# && docker-php-ext-install -j$(nproc) gd
RUN apt clean autoclean && \
apt autoremove -y && \
rm -rf /var/lib/apt/lists/*
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY zz-custom.ini "$PHP_INI_DIR/conf.d/"

3
docker/README.md Normal file
View File

@ -0,0 +1,3 @@
docker build -t php_symfony --progress=plain .
docker run --rm --name phptest php_symfony
docker exec -it phptest bash

View File

@ -0,0 +1,8 @@
version: '3.8'
services:
php:
build: .
restart: unless-stopped
volumes:
- ..:/var/www/html

1
docker/zz-custom.ini Normal file
View File

@ -0,0 +1 @@
short_open_tag = Off