-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (49 loc) · 1.35 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
54
55
56
57
58
59
60
61
62
FROM ubuntu:24.04 AS base
# Prevent interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
software-properties-common \
curl \
git \
nginx \
zip \
unzip \
libpng-dev \
libonig-dev \
libxml2-dev \
libpq-dev
# Install PHP and extensions
RUN add-apt-repository ppa:ondrej/php && \
apt-get update && \
apt-get install -y \
php8.3-fpm \
php8.3-cli \
php8.3-pgsql \
php8.3-mbstring \
php8.3-xml \
php8.3-bcmath \
php8.3-gd \
php8.3-curl
# Ensure PHP-FPM socket directory exists
RUN mkdir -p /run/php && chown -R www-data:www-data /run/php
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs
# Get Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /var/www/html
# Copy application
COPY . .
# Install dependencies
RUN composer install
RUN npm install && npm run build
# Set permissions
RUN chown -R www-data:www-data /var/www/html
# Configure nginx
COPY etc/nginx/default.conf /etc/nginx/sites-available/default
# Start services
CMD service php8.3-fpm start && nginx -g 'daemon off;'