-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
73 lines (58 loc) · 2.01 KB
/
Dockerfile.dev
File metadata and controls
73 lines (58 loc) · 2.01 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Dockerfile pour le développement avec hot reload
FROM php:8.3-fpm
# Arguments
ARG user=formacube
ARG uid=1000
# Installation des dépendances système
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libzip-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libicu-dev \
zip \
unzip \
supervisor \
nginx \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Installation des extensions PHP
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip intl
# Installation de Redis extension
RUN pecl install redis && docker-php-ext-enable redis
# Installation de Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Installation de Node.js 20 LTS
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y nodejs \
&& npm install -g npm@latest
# Création de l'utilisateur système
RUN useradd -G www-data,root -u $uid -d /home/$user $user \
&& mkdir -p /home/$user/.composer \
&& chown -R $user:$user /home/$user
# Configuration PHP
COPY docker/php/php.ini /usr/local/etc/php/conf.d/custom.ini
COPY docker/php/php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
# Configuration Nginx
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/default.dev.conf /etc/nginx/conf.d/default.conf
# Configuration Supervisor (avec Vite dev server)
COPY docker/supervisor/supervisord.dev.conf /etc/supervisor/conf.d/supervisord.conf
# Définir le répertoire de travail
WORKDIR /var/www
# Définir les permissions
RUN mkdir -p /var/www/storage /var/www/bootstrap/cache \
&& chown -R $user:www-data /var/www \
&& chmod -R 775 /var/www
# Exposer les ports
EXPOSE 80 5173
# Script d'entrée
COPY docker/entrypoint.dev.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]