From 72bd48eb25a0d23fe74bb82fac9dbf56ccf981ad Mon Sep 17 00:00:00 2001 From: Edoardo BAROLO Date: Thu, 2 Jan 2025 16:05:55 +0100 Subject: [PATCH] Creazione docker del progetto openstamanager --- docker/Dockerfile | 75 +++++++++++++++++++++++++++++++++++++++ docker/docker-compose.yml | 26 ++++++++++++++ docker/php.ini | 6 ++++ 3 files changed, 107 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml create mode 100644 docker/php.ini diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..28b03f033 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,75 @@ +# Usa l'immagine ufficiale di PHP con Apache +FROM php:8.3-apache + +# Abilita i moduli richiesti +RUN apt-get update && apt-get install -y \ + libzip-dev \ + libicu-dev \ + libcurl4-openssl-dev \ + libxml2-dev \ + libpng-dev \ + libonig-dev \ + unzip \ + libxml2-dev \ + libxslt-dev \ + git && \ + docker-php-ext-install zip mbstring pdo_mysql intl soap curl && \ + a2enmod rewrite + +RUN docker-php-ext-install xsl ftp + +RUN docker-php-ext-enable xsl ftp + +RUN apt-get install -y libpng-dev libjpeg-dev \ + && docker-php-ext-configure gd --with-jpeg \ + && docker-php-ext-install gd + +RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ + && apt-get install -y nodejs + + +# Configura i parametri di PHP +COPY php.ini /usr/local/etc/php/ + +# Installa Composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +# Configura l'applicazione +WORKDIR /var/www/html +# Esponi la porta per Apache +EXPOSE 80 + +# Clona il repository +RUN git clone https://github.com/devcode-it/openstamanager.git /var/www/html + +RUN mkdir -p /var/www/html/files/temp /var/www/html/logs +RUN chmod -R 777 /var/www/html/files /var/www/html/logs +RUN touch /var/www/html/manifest.json \ + /var/www/html/mariadb_10_x.json \ + /var/www/html/mysql_8_3.json \ + /var/www/html/mysql.json \ + /var/www/html/checksum.json \ + /var/www/html/settings.json + +RUN chown -R $USER:www-data * + +# Installa le dipendenze PHP con Composer +#RUN composer install + +# Installa Gulp globalmente con Yarn +#RUN yarn global add gulp +#RUN npm install -g gulp husky + + +# Installa le dipendenze Node.js +#RUN npm install + +# Esegui Gulp per la build +#RUN gulp +RUN curl -sS https://getcomposer.org/installer | php +RUN git config --global --add safe.directory /var/www/html +RUN corepack enable +RUN corepack prepare yarn@stable --activate + +RUN yarn run develop-OSM + diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 000000000..c526fee0c --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,26 @@ +services: + app: + build: + context: . + container_name: openstamanager + ports: + - "8090:80" + depends_on: + - db + environment: + - APP_ENV=local + - DB_HOST=db + - DB_PORT=3306 + - DB_DATABASE=openstamanager + - DB_USERNAME=root + - DB_PASSWORD=secret + + db: + image: mysql:8.4 + container_name: mysql + restart: always + environment: + MYSQL_ROOT_PASSWORD: secret + MYSQL_DATABASE: openstamanager + ports: + - "3306:3306" diff --git a/docker/php.ini b/docker/php.ini new file mode 100644 index 000000000..8dac0a965 --- /dev/null +++ b/docker/php.ini @@ -0,0 +1,6 @@ +upload_max_filesize = 32M +post_max_size = 32M +max_input_vars = 5000 +display_errors = Off +log_errors = On +error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING