SUPERCAT.DEV

Benvenut* sul mio blog

DOCKER

Coder

26-03-2025

Per poter sviluppare con PHP e Symfony

FROM ubuntu

RUN apt-get update \
	&& apt-get install -y \
	curl \
	git \
	golang \
	sudo \
	vim \
	wget \
	nano \
	p7zip-full \
	p7zip-rar \
	&& rm -rf /var/lib/apt/lists/*

RUN apt-get update \
	&& apt-get install -qq -y --no-install-recommends \
	cron \
	locales coreutils apt-utils git libicu-dev g++ libpng-dev libxml2-dev libzip-dev libonig-dev libxslt-dev

RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
	echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen && \
	echo "it_IT.UTF-8 UTF-8" >> /etc/locale.gen && \
	locale-gen

RUN apt-get update \
	&& apt-get install -y \
	php8.3

RUN apt-get update \
	&& apt-get install -y \
	libapache2-mod-php \
	php8.3-common \
	php8.3-cli \
	php8.3-mbstring \
	php8.3-bcmath \
	php8.3-fpm \
	php8.3-intl \
	php8.3-mysql \ 
	php8.3-zip \
	php8.3-gd \
	php8.3-curl \ 
	php8.3-sqlite \ 
	php8.3-xml

RUN curl -sSk https://getcomposer.org/installer | php -- --disable-tls && \
	mv composer.phar /usr/local/bin/composer

# Install symfony CLI (https://symfony.com/download)
RUN curl -1sLf 'https://dl.cloudsmith.io/public/symfony/stable/setup.deb.sh' | bash
RUN apt install symfony-cli -y
RUN symfony server:ca:install

RUN apt-get update \
	&& apt-get install -y \
	nodejs \
	npm

ARG USER=coder
RUN useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
	&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
	&& chmod 0440 /etc/sudoers.d/${USER}
USER ${USER}

WORKDIR /home/${USER}