Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
60 lines (50 loc) · 1.58 KB
/
Copy pathDockerfile
File metadata and controls
60 lines (50 loc) · 1.58 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
FROM php:8.4-fpm-alpine
# Install required system packages
RUN apk add --no-cache \
curl \
libpng-dev \
libxml2-dev \
libzip-dev \
zip \
unzip \
oniguruma-dev \
icu-dev \
linux-headers \
openssh-client \
git \
nginx \
supervisor \
nodejs \
npm
# Install PHP extensions
RUN docker-php-ext-install \
pdo_mysql \
mbstring \
exif \
pcntl \
bcmath \
gd \
intl \
zip
# Copy Composer binary from official Composer image
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www
# Copy application files with ownership www-data:www-data
COPY --chown=www-data:www-data . /var/www
# Configure shell aliases for convenience
RUN echo 'alias art="php artisan"' >> /root/.profile && \
echo 'alias dep="./vendor/bin/dep"' >> /root/.profile && \
echo 'alias art="php artisan"' >> /root/.shrc && \
echo 'alias dep="./vendor/bin/dep"' >> /root/.shrc && \
echo 'alias art="php artisan"' >> /etc/profile.d/aliases.sh && \
echo 'alias dep="./vendor/bin/dep"' >> /etc/profile.d/aliases.sh
# Set up runtime directories
RUN mkdir -p /run/nginx /var/log/supervisor /etc/nginx/http.d /etc/supervisor/conf.d
# Copy Nginx and Supervisor configuration files
COPY docker/nginx.conf /etc/nginx/http.d/default.conf
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Expose application and Vite dev server ports
EXPOSE 8082 5173
# Start supervisor with supervisord.conf as PID 1
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]