-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (42 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Usa l'immagine di base PHP 8.2 con Apache
FROM php:8.2.18-apache
# Imposta la directory di lavoro
WORKDIR /var/www/html
# Installare le dipendenze necessarie per PHP e strumenti
RUN apt-get update && apt-get install -y \
curl \
git \
zip \
unzip \
libpng-dev \
libjpeg-dev \
libfreetype6-dev \
libonig-dev \
libxml2-dev \
libzip-dev && \
docker-php-ext-configure gd --with-freetype --with-jpeg && \
docker-php-ext-install -j$(nproc) gd && \
docker-php-ext-install -j$(nproc) mysqli pdo pdo_mysql && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Installazione di Node.js e npm
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Verifica dell'installazione di Node.js e npm
RUN node -v && npm -v
# Installazione di Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copia dei file di configurazione
COPY composer.json composer.lock ./
COPY package.json package-lock.json ./
# Installazione delle dipendenze del progetto
RUN COMPOSER_ALLOW_SUPERUSER=1 composer install
RUN npm install
# Compilazione dei file SCSS
RUN npm rebuild node-sass
# Copia il resto dei file del progetto nella directory di lavoro
COPY . .
# Espone le porte necessarie
EXPOSE 80