|
1 | | -# Usa l'immagine ufficiale di PHP con Apache |
2 | 1 | FROM php:8.3-apache-bullseye |
3 | 2 |
|
4 | | -# Abilita i moduli richiesti |
5 | | -RUN apt-get update && apt-get install -y \ |
| 3 | +# Installa dipendenze di sistema ed estensioni PHP |
| 4 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
6 | 5 | libzip-dev \ |
7 | 6 | libicu-dev \ |
8 | 7 | libcurl4-openssl-dev \ |
9 | 8 | libxml2-dev \ |
10 | 9 | libpng-dev \ |
| 10 | + libjpeg-dev \ |
11 | 11 | libonig-dev \ |
| 12 | + libxslt-dev \ |
12 | 13 | unzip \ |
13 | | - libxml2-dev \ |
14 | | - libxslt-dev \ |
15 | | - wget \ |
| 14 | + wget \ |
16 | 15 | git && \ |
17 | | - docker-php-ext-install zip mbstring pdo_mysql intl soap curl && \ |
18 | | - a2enmod rewrite |
| 16 | + docker-php-ext-configure gd --with-jpeg && \ |
| 17 | + docker-php-ext-install \ |
| 18 | + zip \ |
| 19 | + mbstring \ |
| 20 | + pdo_mysql \ |
| 21 | + intl \ |
| 22 | + soap \ |
| 23 | + curl \ |
| 24 | + xsl \ |
| 25 | + ftp \ |
| 26 | + gd && \ |
| 27 | + a2enmod rewrite && \ |
| 28 | + curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ |
| 29 | + apt-get install -y nodejs && \ |
| 30 | + apt-get clean && \ |
| 31 | + rm -rf /var/lib/apt/lists/* /tmp/* |
19 | 32 |
|
20 | | -RUN docker-php-ext-install xsl ftp |
21 | | - |
22 | | -RUN docker-php-ext-enable xsl ftp |
23 | | - |
24 | | -RUN apt-get install -y libpng-dev libjpeg-dev \ |
25 | | - && docker-php-ext-configure gd --with-jpeg \ |
26 | | - && docker-php-ext-install gd |
27 | | - |
28 | | -RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \ |
29 | | - && apt-get install -y nodejs |
30 | | - |
31 | | - |
32 | | -# Configura i parametri di PHP |
| 33 | +# Copia configurazione PHP |
33 | 34 | COPY php.ini /usr/local/etc/php/ |
34 | 35 |
|
35 | | -# Installa Composer |
| 36 | +# Installa Composer dall'immagine ufficiale |
36 | 37 | COPY --from=composer:latest /usr/bin/composer /usr/bin/composer |
37 | 38 |
|
38 | | -# Configura l'applicazione |
| 39 | +# Imposta directory di lavoro |
39 | 40 | WORKDIR /var/www/html |
40 | | -# Esponi la porta per Apache |
41 | | -EXPOSE 80 |
42 | 41 |
|
43 | | -# Clona il repository |
44 | | -RUN git clone https://github.com/devcode-it/openstamanager.git /var/www/html |
| 42 | +# Clona repository e inizializza directory |
| 43 | +RUN git clone https://github.com/devcode-it/openstamanager.git . && \ |
| 44 | + git config --global --add safe.directory /var/www/html && \ |
| 45 | + mkdir -p files/temp logs |
| 46 | + |
| 47 | +# Crea file di configurazione |
| 48 | +RUN touch manifest.json \ |
| 49 | + mariadb_10_x.json \ |
| 50 | + mysql_8_3.json \ |
| 51 | + mysql.json \ |
| 52 | + checksum.json \ |
| 53 | + settings.json \ |
| 54 | + views.json \ |
| 55 | + modules.json |
45 | 56 |
|
46 | | -RUN mkdir -p /var/www/html/files/temp /var/www/html/logs |
47 | | -RUN chown -R $USER:www-data /var/www/html/ |
48 | | -RUN chmod -R 770 /var/www/html/ |
49 | | -RUN touch /var/www/html/manifest.json \ |
50 | | - /var/www/html/mariadb_10_x.json \ |
51 | | - /var/www/html/mysql_8_3.json \ |
52 | | - /var/www/html/mysql.json \ |
53 | | - /var/www/html/checksum.json \ |
54 | | - /var/www/html/settings.json \ |
55 | | - /var/www/html/views.json |
56 | | - /var/www/html/modules.json |
| 57 | +# Installa dipendenze PHP con Composer |
| 58 | +RUN curl -sS https://getcomposer.org/installer | php && \ |
| 59 | + php composer.phar install |
57 | 60 |
|
58 | | -RUN curl -sS https://getcomposer.org/installer | php |
59 | | -RUN git config --global --add safe.directory /var/www/html |
60 | | -RUN corepack enable |
61 | | -RUN corepack prepare yarn@stable --activate |
| 61 | +# Installa dipendenze Node.js e compila asset |
| 62 | +RUN corepack enable && \ |
| 63 | + corepack prepare yarn@stable --activate && \ |
| 64 | + yarn run develop-OSM |
62 | 65 |
|
63 | | -RUN yarn run develop-OSM |
| 66 | +# Imposta permessi corretti per i file dell'applicazione |
| 67 | +RUN chown -R www-data:www-data /var/www/html && \ |
| 68 | + chmod -R 755 /var/www/html && \ |
| 69 | + chmod -R 775 /var/www/html/files /var/www/html/logs /var/www/html/storage |
64 | 70 |
|
| 71 | +# Espone porta Apache |
| 72 | +EXPOSE 80 |
0 commit comments