-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (39 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
50 lines (39 loc) · 1.09 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
# Étape 1 : Build frontend avec Vite
FROM node:20-alpine AS node_build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Étape 2 : PHP 8.3 + extensions
FROM php:8.3-fpm-alpine
# Installer dépendances pour PHP et PostgreSQL
RUN apk add --no-cache \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
zip \
unzip \
git \
libpq \
libpq-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd pdo pdo_pgsql pgsql exif \
&& docker-php-ext-enable exif
# Installer Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Définir le dossier de travail
WORKDIR /var/www/html
# Copier le projet Laravel
COPY . .
# Copier le build frontend
COPY --from=node_build /app/public/build /var/www/html/public/build
# Permissions
RUN chown -R www-data:www-data storage bootstrap/cache \
&& chmod -R 775 storage bootstrap/cache
# Entrypoint
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 80
ENTRYPOINT ["/entrypoint.sh"]
CMD ["php", "-S", "0.0.0.0:80", "-t", "public"]